def get_trace_all(trace_level): folder = '%s/%s' % (strTraceFolder, s.time_now_folder()) if trace_level: for ip in list_engines_IP: Action(ip, telnet_port, passwd, FTP_port).get_trace( folder, trace_level) else: for ip in list_engines_IP: Action(ip, telnet_port, passwd, FTP_port).get_trace( folder, trace_level_cfg)
def get_trace(ip, trace_level): folder = '%s/%s' % (strTraceFolder, s.time_now_folder()) try: if trace_level: Action(ip, telnet_port, passwd, FTP_port).get_trace( folder, trace_level) else: Action(ip, telnet_port, passwd, FTP_port).get_trace( folder, trace_level_cfg) finally: return folder
def periodically_check(ip): PCFile_name = 'PC_%s_SANSwitch_%s.log' % (s.time_now_folder(), ip) Action(ip, ssh_port, user, passwd, []).periodic_check(lstPCCommand, strPCFolder, PCFile_name)
def backup_config(ip): folder = '%s/%s' % (strCFGFolder, s.time_now_folder()) Action(ip, telnet_port, passwd, FTP_port).backup(folder)
def backup_config_all(): folder = '%s/%s' % (strCFGFolder, s.time_now_folder()) for ip in list_engines_IP: Action(ip, telnet_port, passwd, FTP_port).backup(folder)
def periodically_check(ip): PCFile_name = 'PC_%s_Engine_%s.log' % ( s.time_now_folder(), ip) Action(ip, telnet_port, passwd, FTP_port).periodic_check( lstPCCommand, strPCFolder, PCFile_name)
def test_time_now_folder(): assert sun.time_now_folder()