def __createTestClient(self): ''' @Name : __createTestClient @Desc : Creates the TestClient during init based upon the parameters provided @Output: Returns SUCCESS or FAILED ''' try: mgt_details = self.__parsedConfig.mgtSvr[0] dbsvr_details = self.__parsedConfig.dbSvr self.__testClient = CSTestClient( mgt_details, dbsvr_details, logger=self.__tcRunLogger, test_data_filepath=self.__testDataFilePath, zone=self.__zoneForTests, hypervisor_type=self.__hypervisorType) if self.__testClient: return self.__testClient.createTestClient() return FAILED except Exception as e: print "\n Exception Occurred Under __createTestClient : %s" % \ GetDetailExceptionInfo(e) return FAILED
def __createTestClient(self): ''' @Name : __createTestClient @Desc : Creates the TestClient during init based upon the parameters provided @Output: Returns SUCCESS or FAILED ''' try: mgt_details = self.__parsedConfig.mgtSvr[0] dbsvr_details = self.__parsedConfig.dbSvr self.__testClient = CSTestClient( mgt_details, dbsvr_details, test_data_filepath=self.__testDataFilePath, zone=self.__zoneForTests, hypervisor_type=self.__hypervisorType) if self.__testClient: return self.__testClient.createTestClient() return FAILED except Exception as e: self.__tcRunLogger.exception( "=== Marvin Create Test Client Failed: %s ===" % e) return FAILED
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() tmp_dict = {} zones = Zone.list(apiClient) if zones: for zone in zones: print "zone name={}, id={}".format(zone.name, zone.id) if zone.allocationstate == 'Enabled': print "Disable zone" zoneCmd = updateZone.updateZoneCmd()