def check_node(): result = True node_list = get_node_list() if not is_needed_node_available(node_list): print "Please first make the node working!" return for node in node_list: if not check_rg_status("/"+node): result = False return result
tdm_list = get_spec_node_list(node_list_all, "TDM") active_tcu_list = get_active_tcu(tcu_list) ret = True ret = check_node_list(tdm_list) and ret ret = check_node_list(active_tcu_list) and ret ret = check_needed_rg(g_rg_list) and ret check_clock() return ret from optparse import OptionParser if __name__ == '__main__': usage = "usage: %prog [options] arg" parser = OptionParser(usage) parser.add_option("-a", "--all", action="store_true", dest="check_all_flag", default=False) opts, args = parser.parse_args() node_list = get_node_list() ret = False if(opts.check_all_flag): ret = check_all(node_list) else: ret = check_for_link(node_list) # os.system('tail -f /srv/Log/log/syslog | grep srm') if ret: print ("Check ok") else: print("Not all check passed, please first check the RU and clock status")
#!/usr/bin/python import os from check_ru import check_for_link from clear_res import clear_all from get_sys_info import get_node_list, get_spec_node_list, get_active_tcu print("call check_all ") node_list = get_node_list() if check_for_link(node_list): print("All Check is ok") print("Start to create Link......") tcu_list = get_spec_node_list(node_list, "TCU") tdm_list = get_spec_node_list(node_list, "TDM") active_tcu_list = get_active_tcu(tcu_list) clear_all(tdm_list, active_tcu_list) os.system('tail -f /srv/Log/log/syslog | grep srm') else: print("Not all check passed, check it first!!!") print("Start to create Link......") tcu_list = get_spec_node_list(node_list, "TCU") tdm_list = get_spec_node_list(node_list, "TDM") active_tcu_list = get_active_tcu(tcu_list) clear_all(tdm_list, active_tcu_list) os.system('tail -f /srv/Log/log/syslog | grep srm')