""" from marvin.marvinLog import MarvinLog from marvin.cloudstackTestClient import CSTestClient """ Step1: Create the Logger """ if (options.input) and not (os.path.isfile(options.input)): print "\n=== Invalid Input Config File Path, Please Check ===" exit(1) log_obj = MarvinLog("CSLog") cfg = configGenerator.getSetupConfig(options.input) log = cfg.logger ret = log_obj.createLogs("DeployDataCenter", log) if ret != FAILED: log_folder_path = log_obj.getLogFolderPath() tc_run_logger = log_obj.getLogger() else: print "\n===Log Creation Failed. Please Check===" exit(1) """ Step2 : Create Test Client """ obj_tc_client = CSTestClient(cfg.mgtSvr[0], cfg.dbSvr, logger=tc_run_logger) if obj_tc_client and obj_tc_client.createTestClient() == FAILED: print "\n=== TestClient Creation Failed===" exit(1)
if options.input is None: print "\n==== For cleaning: Please Specify a " \ "Valid Input Configuration File ====" exit(1) if (options.input) and not (os.path.isfile(options.input)): print "\n=== Invalid Input Config File Path, Please Check ===" exit(1) from marvin.marvinLog import MarvinLog from marvin.cloudstackTestClient import CSTestClient log_obj = MarvinLog("CSLogClean") cfg = configGenerator.getSetupConfig(options.input) log = cfg.logger ret = log_obj.createLogs("Clean_Infra", log) if ret != FAILED: log_folder_path = log_obj.getLogFolderPath() tc_run_logger = log_obj.getLogger() else: print "\n=== Log Creation Failed. Please Check ===" exit(1) obj_tc_client = CSTestClient(cfg.mgtSvr[0], cfg.dbSvr, logger=tc_run_logger) if obj_tc_client and obj_tc_client.createTestClient() == FAILED: print "\n=== TestClient Creation Failed ===" exit(1) if (options.input) and (os.path.isfile(options.input)): apiClient = obj_tc_client.getApiClient()
if (options.upload_iso is None) and (options.upload_tmpl is None): print "\n==== For uploading file: Please Specify a " \ "HTTP path for file ====" exit(1) if (options.input) and not (os.path.isfile(options.input)): print "\n=== Invalid Input Config File Path, Please Check ===" exit(1) from marvin.marvinLog import MarvinLog from marvin.cloudstackTestClient import CSTestClient log_obj = MarvinLog("CSLogTemplates") cfg = configGenerator.getSetupConfig(options.input) log = cfg.logger ret = log_obj.createLogs("UploadTemplates", log) if ret != FAILED: log_folder_path = log_obj.getLogFolderPath() tc_run_logger = log_obj.getLogger() else: print "\n=== Log Creation Failed. Please Check ===" exit(1) obj_tc_client = CSTestClient(cfg.mgtSvr[0], cfg.dbSvr, logger=tc_run_logger) if obj_tc_client and obj_tc_client.createTestClient() == FAILED: print "\n=== TestClient Creation Failed ===" exit(1) if (options.input) and (os.path.isfile(options.input)):
print "\n==== For DeleteDataCenters: Please Specify a " \ "Valid Input Configuration File and DC Settings====" exit(1) ''' Imports the Modules Required ''' from marvin.marvinLog import MarvinLog from marvin.cloudstackTestClient import CSTestClient ''' Step1: Create the Logger ''' log_obj = MarvinLog("CSLog") cfg = configGenerator.getSetupConfig(options.input) log = cfg.logger ret = log_obj.createLogs("DeployDataCenter", log) if ret != FAILED: log_folder_path = log_obj.getLogFolderPath() tc_run_logger = log_obj.getLogger() else: print "\n===Log Creation Failed. Please Check===" exit(1) ''' Step2 : Create Test Client ''' obj_tc_client = CSTestClient(cfg.mgtSvr[0], cfg.dbSvr, logger=tc_run_logger) if obj_tc_client and obj_tc_client.createTestClient() == FAILED: print "\n=== TestClient Creation Failed===" exit(1)
if (options.upload_iso is None) and (options.upload_tmpl is None): print "\n==== For uploading file: Please Specify a " \ "HTTP path for file ====" exit(1) if (options.input) and not (os.path.isfile(options.input)): print "\n=== Invalid Input Config File Path, Please Check ===" exit(1) from marvin.marvinLog import MarvinLog from marvin.cloudstackTestClient import CSTestClient log_obj = MarvinLog("CSLogTemplates") cfg = configGenerator.getSetupConfig(options.input) log = cfg.logger ret = log_obj.createLogs("UploadTemplates", log) if ret != FAILED: log_folder_path = log_obj.getLogFolderPath() tc_run_logger = log_obj.getLogger() else: print "\n=== Log Creation Failed. Please Check ===" exit(1) obj_tc_client = CSTestClient(cfg.mgtSvr[0], cfg.dbSvr, logger=tc_run_logger) if obj_tc_client and obj_tc_client.createTestClient() == FAILED: print "\n=== TestClient Creation Failed ===" exit(1) if (options.input) and (os.path.isfile(options.input)): apiClient = obj_tc_client.getApiClient()