def init(self): node = get_dir_list(infrasim_home) # remove the file whose name starts from "." for nd in node: if nd[0] is not '.' and Workspace.check_node(nd): nd_status = NodeStatus(nd) self.__node_list.append(nd_status)
def destroy_existing_nodes(): nodes = os.listdir(config.infrasim_home) if os.path.exists(config.infrasim_node_config_map): nodes.remove('.node_map') if os.path.exists(config.infrasim_chassis_config_map): nodes.remove('.chassis_map') for node in nodes: if Workspace.check_node(node): os.system("infrasim node destroy {}".format(node)) else: os.system("infrasim chassis destroy {}".format(node))