def uploadFileRest(managerHostConfig): try: logger.info("uploadFileRest : managerHostConfig : " + str(managerHostConfig)) #/home/ec2-user/TieredStorageImpl-1.0-SNAPSHOT.jar global pathOfSourcePU pathOfSourcePU = str( readValuefromAppConfig("app.tieredstorage.pu.filepath")).replace( '"', '') pathOfSourcePUInput = str( input( Fore.YELLOW + "Enter path including filename of processing unit to deploy [" + str(pathOfSourcePU) + "]:" + Fore.RESET)) if (len(str(pathOfSourcePUInput)) > 0): pathOfSourcePU = pathOfSourcePUInput while (len(str(pathOfSourcePU)) == 0): pathOfSourcePU = str( input( Fore.YELLOW + "Enter path including filename of processing unit to deploy :" + Fore.RESET)) logger.info("pathOfSourcePU :" + str(pathOfSourcePU)) set_value_in_property_file('app.tieredstorage.pu.filepath', str(pathOfSourcePU)) logger.info("url : " + "curl -X PUT -F 'file=@" + str(pathOfSourcePU) + "' http://" + managerHostConfig + ":8090/v2/pus/resources") status = os.system("curl -X PUT -F 'file=@" + str(pathOfSourcePU) + "' http://" + managerHostConfig + ":8090/v2/pus/resources") logger.info("status : " + str(status)) except Exception as e: handleException(e)
def proceedForInputParams(): logger.info("proceedForInputParams()") global drainMode global drainTimeout #drainMode = "ATTEMPT" drainMode = readValuefromAppConfig("app.tieredstorage.drainmode") drainModeConfirm = str( input(Fore.YELLOW + "Enter drain mode [" + str(drainMode) + "] :" + Fore.RESET)) if (len(str(drainModeConfirm)) > 0): drainMode = drainModeConfirm logger.info("drainMode : " + str(drainMode)) drainTimeout = readValuefromAppConfig("app.tieredstorage.drainTimeout") drainTimeoutConfirm = str( input(Fore.YELLOW + "Enter drain mode timeout [" + str(drainTimeout) + "] : " + Fore.RESET)) if (len(str(drainTimeoutConfirm)) > 0): drainTimeout = drainTimeoutConfirm logger.info("drainTimeout : " + str(drainTimeout))
def getGSCForHost(): logger.info("getGSCForHost") managerServerConfig = readValuefromAppConfig("app.manager.hosts") host_gsc_dict_obj = host_nic_dictionary() host_gsc_mul_host_dict_obj = host_nic_dictionary() managerServerConfigArr = [] if (str(managerServerConfig).__contains__(',') ): # if cluster manager configured managerServerConfig = str(managerServerConfig).replace('"', '') managerServerConfigArr = managerServerConfig.split(',') logger.info("MangerServerConfigArray: " + str(managerServerConfigArr)) host_gsc_dict_obj = getGSCByManagerServerConfig( managerServerConfigArr[0], host_gsc_dict_obj) else: logger.info("managerServerConfig :" + str(managerServerConfig)) host_gsc_dict_obj = getGSCByManagerServerConfig( managerServerConfig, host_gsc_dict_obj) return host_gsc_dict_obj
def listSpaceServer(): try: logger.debug("listing space server") logger.info("listSpaceServer()") spaceServers = config_get_space_hosts() verboseHandle.printConsoleWarning("Servers -> Space -> List\n") headers = [ Fore.YELLOW + "IP" + Fore.RESET, Fore.YELLOW + "Host" + Fore.RESET, Fore.YELLOW + "GSC" + Fore.RESET, Fore.YELLOW + "Resume Mode" + Fore.RESET, Fore.YELLOW + "Status" + Fore.RESET #Fore.YELLOW+"Version"+Fore.RESET ] data = [] userConfig = readValuefromAppConfig("app.server.user") # changed : 25-Aug hence systemctl always with root no need to ask #user = str(input("Enter your user ["+userConfig+"]: ")) #if(len(str(user))==0): # user=userConfig user = '******' logger.info("app.server.user: "******"server.ip : " + str(server.ip) + " cmd :" + str(cmd)) output = executeRemoteCommandAndGetOutputPython36( server.ip, user, cmd) logger.info( "executeRemoteCommandAndGetOutputPython36 : output:" + str(output)) host_nic_dict_obj.add(server.ip, str(output)) else: logger.info(" Host :" + str(server.ip) + " is not reachable") logger.info("host_nic_dict_obj : " + str(host_nic_dict_obj)) for server in spaceServers: logger.info("server.ip : " + str(server.ip)) #status = getStatusOfHost(host_nic_dict_obj,server) status = '' gsc = '' if (port_check_config(server.ip, 22)): status = getStatusOfSpaceHost(str(server.ip)) logger.info("status : " + str(status)) logger.info("Host:" + str(server.name)) gsc = host_gsc_dict_obj.get(str(server.name)) logger.info("GSC : " + str(gsc)) else: status = "NOT REACHABLE" gsc = host_gsc_dict_obj.get(str(server.name)) logger.info(" Host :" + str(server.ip) + " is not reachable") #version = getVersion(server.ip) if (status == "ON"): dataArray = [ Fore.GREEN + server.ip + Fore.RESET, Fore.GREEN + server.name + Fore.RESET, Fore.GREEN + str(gsc) + Fore.RESET, Fore.GREEN + server.resumeMode + Fore.RESET, Fore.GREEN + str(status) + Fore.RESET #Fore.GREEN+str(version)+Fore.RESET ] else: dataArray = [ Fore.GREEN + server.ip + Fore.RESET, Fore.GREEN + server.name + Fore.RESET, Fore.GREEN + str(gsc) + Fore.RESET, Fore.GREEN + server.resumeMode + Fore.RESET, Fore.RED + str(status) + Fore.RESET #Fore.GREEN+str(version)+Fore.RESET ] data.append(dataArray) printTabular(None, headers, data) except Exception as e: logger.error("Error in odsx_servers_space_list " + str(e))
def getHostConfiguration(): hostsConfig = "" hostConfigArray = [] hostConfiguration = "" wantNicAddress = "" hostsConfig = readValuefromAppConfig("app.manager.hosts") logger.info("hostsConfig : " + str(hostsConfig)) hostConfigArray = hostsConfig.replace('"', '').split(",") applicativeUserFile = readValuefromAppConfig("app.server.user") applicativeUser = str( input(Fore.YELLOW + "Applicative user [" + applicativeUserFile + "]: " + Fore.RESET)) if (len(str(applicativeUser)) == 0): applicativeUser = str(applicativeUserFile) logger.info("Applicative user : "******"', '') logger.info("hostsConfig==2 : " + str(hostsConfig)) if (len(str(hostsConfig)) > 0): logger.info("hostsConfig>0 : " + str(hostsConfig)) verboseHandle.printConsoleWarning("Current cluster configuration : [" + hostsConfig + "] ") hostConfiguration = str( input( "press [1] if you want to modify cluster configuration. \nPress [Enter] to continue with current Configuration. : " + Fore.RESET)) logger.info("hostConfiguration : " + str(hostConfiguration)) wantNicAddress = str( input( Fore.YELLOW + "Do you want to configure GS_NIC_ADDRESS for host ? [yes (y) / no (n)]: " + Fore.RESET)) while (len(str(wantNicAddress)) == 0): wantNicAddress = str( input( Fore.YELLOW + "Do you want to configure GS_NIC_ADDRESS for host ? [yes (y) / no (n)]: " + Fore.RESET)) logger.info("wantNicAddress : " + str(wantNicAddress)) if (hostConfiguration != '1'): logger.info("hostConfiguration !=1 : " + str(hostConfiguration)) for host in hostConfigArray: logger.info("host : " + str(host)) if (wantNicAddress == "yes" or wantNicAddress == "y"): logger.info("wantNicAddress : " + str(wantNicAddress)) gsNICAddress = str( input(Fore.YELLOW + 'Enter GS_NIC_ADDRESS for host ' + host + " :" + Fore.RESET)) while (len(str(gsNICAddress)) == 0): gsNICAddress = str( input(Fore.YELLOW + 'Enter GS_NIC_ADDRESS for host ' + host + " :" + Fore.RESET)) host_nic_dict_obj.add(host, gsNICAddress) logger.info("host_nic_dict_obj : " + str(host_nic_dict_obj)) if (wantNicAddress == "no" or wantNicAddress == "n"): logger.info("wantNicAddress : " + str(wantNicAddress)) gsNICAddress = "x" host_nic_dict_obj.add(host, gsNICAddress) logger.info("host_nic_dict_obj : " + str(host_nic_dict_obj)) if (len(str(hostsConfig)) == 0) or (hostConfiguration == '1'): gsNicAddress = "" gsNicAddress1 = "" gsNicAddress2 = "" gsNicAddress3 = "" managerType = int( input("Enter manager installation type: " + Fore.YELLOW + "\n[1] Single \n[2] Cluster : " + Fore.RESET)) logger.info("managerType : " + str(managerType)) if (managerType == 1): logger.info("managerType : " + str(managerType)) hostsConfig = str( input(Fore.YELLOW + "Enter manager host: " + Fore.RESET)) while (len(str(hostsConfig)) == 0): hostsConfig = str( input(Fore.YELLOW + "Enter manager host: " + Fore.RESET)) logger.info("hostsConfig : " + str(hostsConfig)) if (len(str(wantNicAddress)) == 0): wantNicAddress = str( input( Fore.YELLOW + "Do you want to configure GS_NIC_ADDRESS for host ? [yes (y) / no (n)]: " + Fore.RESET)) logger.info("wantNicAddress : " + str(wantNicAddress)) if (wantNicAddress == "yes" or wantNicAddress == "y"): logger.info("wantNicAddress Y") gsNicAddress = str( input(Fore.YELLOW + 'Enter GS_NIC_ADDRESS for host ' + hostsConfig + " :" + Fore.RESET)) logger.info("gsNicAddress for host " + str(hostsConfig) + ": " + str(gsNicAddress)) if (wantNicAddress == "no" or wantNicAddress == "n"): logger.info("wantNicAddress N") gsNicAddress = "x" host_nic_dict_obj.add(hostsConfig, gsNicAddress) logger.info("host_nic_dict_obj : " + str(host_nic_dict_obj)) if (len(hostsConfig) <= 0): logger.info( "Invalid host. Host configuration is required please specify valid host ip.:" + str(hostsConfig)) verboseHandle.printConsoleError( "Invalid host. Host configuration is required please specify valid host ip." ) #break elif (managerType == 2): logger.info("managerType==2 : " + str(managerType)) host1 = str( input(Fore.YELLOW + "Enter manager host1: " + Fore.RESET)) while (len(str(host1)) == 0): host1 = str( input(Fore.YELLOW + "Enter manager host1: " + Fore.RESET)) host2 = str( input(Fore.YELLOW + "Enter manager host2: " + Fore.RESET)) while (len(str(host2)) == 0): host2 = str( input(Fore.YELLOW + "Enter manager host2: " + Fore.RESET)) host3 = str( input(Fore.YELLOW + "Enter manager host3: " + Fore.RESET)) while (len(str(host3)) == 0): host3 = str( input(Fore.YELLOW + "Enter manager host3: " + Fore.RESET)) #wantNicAddress = str(input(Fore.YELLOW+"Do you want to configure GS_NIC_ADDRESS for host ? [yes (y) / no (n)]: "+Fore.RESET)) logger.info("wantNicAddress : " + str(wantNicAddress)) if (wantNicAddress == "yes" or wantNicAddress == "y"): logger.info("wantNicAddress : " + str(wantNicAddress)) gsNicAddress1 = str( input(Fore.YELLOW + 'Enter GS_NIC_ADDRESS for host ' + host1 + " :" + Fore.RESET)) while (len(str(gsNicAddress1)) == 0): gsNicAddress1 = str( input(Fore.YELLOW + 'Enter GS_NIC_ADDRESS for host ' + host1 + " :" + Fore.RESET)) gsNicAddress2 = str( input(Fore.YELLOW + 'Enter GS_NIC_ADDRESS for host ' + host2 + " :" + Fore.RESET)) while (len(str(gsNicAddress2)) == 0): gsNicAddress2 = str( input(Fore.YELLOW + 'Enter GS_NIC_ADDRESS for host ' + host2 + " :" + Fore.RESET)) gsNicAddress3 = str( input(Fore.YELLOW + 'Enter GS_NIC_ADDRESS for host ' + host3 + " :" + Fore.RESET)) while (len(str(gsNicAddress3)) == 0): gsNicAddress3 = str( input(Fore.YELLOW + 'Enter GS_NIC_ADDRESS for host ' + host3 + " :" + Fore.RESET)) host_nic_dict_obj.add(host1, gsNicAddress1) host_nic_dict_obj.add(host2, gsNicAddress2) host_nic_dict_obj.add(host3, gsNicAddress3) logger.info("host_nic_dict_obj : " + str(host_nic_dict_obj)) if (len(host1) <= 0 or len(host2) <= 0 or len(host3) <= 0): logger.info( "Invalid host. Host configuration is required please specify valid host ip." ) verboseHandle.printConsoleError( "Invalid host. Host configuration is required please specify valid host ip." ) #break hostsConfig = host1 + ',' + host2 + ',' + host3 logger.info("hostsConfig : " + str(hostsConfig)) else: logger.info( "Invalid input host option configuration is required please specify valid host ip." ) verboseHandle.printConsoleError( "Invalid input host option configuration is required please specify valid host ip." ) if (len(hostsConfig) > 0): set_value_in_property_file('app.manager.hosts', hostsConfig) return hostsConfig
def execute_ssh_server_manager_install(hostsConfig, user): hostManager = [] gsNicAddress = '' additionalParam = '' hostManager = hostsConfig.replace('"', '').split(",") #print("optionID:"+str(hostsConfig)+" : "+user) logger.debug("optionID:" + str(hostsConfig)) gsOptionExtFromConfig = readValueByConfigObj("app.manager.gsOptionExt") #gsOptionExtFromConfig = '"{}"'.format(gsOptionExtFromConfig) additionalParam = str( input(Fore.YELLOW + "Enter target directory to install GS [/dbagiga]: " + Fore.RESET)) gsOptionExt = str( input(Fore.YELLOW + 'Enter GS_OPTIONS_EXT [' + gsOptionExtFromConfig + ']: ' + Fore.RESET)) if (len(str(gsOptionExt)) == 0): #gsOptionExt='\"-Dcom.gs.work=/dbagigawork -Dcom.gigaspaces.matrics.config=/dbagiga/gs_config/metrics.xml\"' gsOptionExt = gsOptionExtFromConfig else: set_value_in_property_file('app.manager.gsOptionExt', gsOptionExt) gsOptionExt = '"\\"{}\\""'.format(gsOptionExt) #print("gsoptionext:"+gsOptionExt) gsManagerOptionsFromConfig = readValueByConfigObj( "app.manager.gsManagerOptions") #gsManagerOptionsFromConfig = '"{}"'.format(gsManagerOptionsFromConfig) gsManagerOptions = str( input(Fore.YELLOW + 'Enter GS_MANAGER_OPTIONS [' + gsManagerOptionsFromConfig + ']: ' + Fore.RESET)) if (len(str(gsManagerOptions)) == 0): #gsManagerOptions="-Dcom.gs.hsqldb.all-metrics-recording.enabled=false" gsManagerOptions = gsManagerOptionsFromConfig else: set_value_in_property_file('app.manager.gsManagerOptions', gsManagerOptions) gsManagerOptions = '"{}"'.format(gsManagerOptions) gsLogsConfigFileFromConfig = readValueByConfigObj( "app.manager.gsLogsConfigFile") #gsLogsConfigFileFromConfig = '"{}"'.format(gsLogsConfigFileFromConfig) gsLogsConfigFile = str( input(Fore.YELLOW + 'Enter GS_LOGS_CONFIG_FILE [' + gsLogsConfigFileFromConfig + ']: ' + Fore.RESET)) if (len(str(gsLogsConfigFile)) == 0): #gsLogsConfigFile="/dbagiga/gs_config/xap_logging.properties" gsLogsConfigFile = gsLogsConfigFileFromConfig else: set_value_in_property_file('app.manager.gsLogsConfigFile', gsLogsConfigFile) gsLogsConfigFile = '"{}"'.format(gsLogsConfigFile) licenseConfig = readValueByConfigObj("app.manager.license") #licenseConfig='"{}"'.format(licenseConfig) gsLicenseFile = str( input(Fore.YELLOW + 'Enter GS_LICENSE [' + licenseConfig + ']: ' + Fore.RESET)) if (len(str(gsLicenseFile)) == 0): gsLicenseFile = licenseConfig #else: #gsLicenseFile = str(gsLicenseFile).replace(";","\;") gsLicenseFile = '"\\"{}\\""'.format(gsLicenseFile) applicativeUser = read_value_in_property_file_generic_section( 'User', 'install/gs.service', 'Service') #print("Applicative User: "******"app.user.nofile.limit")) nofileLimitFile = str( input(Fore.YELLOW + 'Enter user level open file limit : [' + nofileLimit + ']: ' + Fore.RESET)) logger.info("hardNofileLimitFile : " + str(nofileLimitFile)) if (len(str(nofileLimitFile)) == 0): nofileLimitFile = nofileLimit #else: # set_value_in_property_file('app.user.hard.nofile',hardNofileLimitFile) nofileLimitFile = '"{}"'.format(nofileLimitFile) #To Display Summary :: ''' 1. Current cluster configuration 2. GS_NIC_Address configuration 3. Target Directory 4. GS_Op_Ext 5. GS_mgr_op 6. GS_Log_config 7. GS_Lic 8. User_openfile_limit ''' if (len(additionalParam) == 0): additionalParam = 'true' + ' ' + '/dbagiga' + ' ' + hostsConfig + ' ' + gsOptionExt + ' ' + gsManagerOptions + ' ' + gsLogsConfigFile + ' ' + gsLicenseFile + ' ' + applicativeUser + ' ' + nofileLimitFile else: additionalParam = 'true' + ' ' + additionalParam + ' ' + hostsConfig + ' ' + hostsConfig + ' ' + gsOptionExt + ' ' + gsManagerOptions + ' ' + gsLogsConfigFile + ' ' + gsLicenseFile + ' ' + applicativeUser + ' ' + nofileLimitFile #print('additional param :'+additionalParam) logger.debug('additional param :' + additionalParam) output = "" for host in hostManager: gsNicAddress = host_nic_dict_obj[host] logger.info("NIC address:" + gsNicAddress + " for host " + host) if (len(str(gsNicAddress)) == 0): gsNicAddress = 'x' # put dummy param to maintain position of arguments additionalParam = additionalParam + ' ' + gsNicAddress #print(additionalParam) logger.info( "Building .tar file : tar -cvf install/install.tar install") cmd = 'tar -cvf install/install.tar install' with Spinner(): status = os.system(cmd) logger.info("Creating tar file status : " + str(status)) with Spinner(): scp_upload(host, user, 'install/install.tar', '') scp_upload(host, user, 'install/gs.service', '') verboseHandle.printConsoleInfo(output) cmd = 'tar -xvf install.tar' verboseHandle.printConsoleInfo("Extracting..") with Spinner(): output = executeRemoteCommandAndGetOutput(host, user, cmd) logger.info("Extracting .tar file :" + str(output)) verboseHandle.printConsoleInfo(str(output)) #Checking Applicative User exist or not ''' cmd = 'id -u '+applicativeUser logger.info("cmd : "+cmd) verboseHandle.printConsoleInfo("Validating applicative user") with Spinner(): output = executeRemoteCommandAndGetOutputPython36(host, user, cmd) #print(output) if(str(output) == '0'): print("exist") else: print("Not exist") logger.info("Validating applicative user :"******"scripts/servers_manager_install.sh" #print(additionalParam) logger.debug("Additinal Param:" + additionalParam + " cmdToExec:" + commandToExecute + " Host:" + str(host) + " User:"******"Output : scripts/servers_manager_install.sh :" + str(outputShFile)) serverHost = '' try: serverHost = socket.gethostbyaddr(host).__getitem__(0) except Exception as e: serverHost = host managerList = config_add_manager_node(host, host, "admin", "true") logger.info("Installation of manager server " + str(host) + " has been done!") verboseHandle.printConsoleInfo("Installation of manager server " + host + " has been done!")
quit() for arg in sys.argv[1:]: args.append(arg) # print('install :',args) elif (sys.argv[1] == menuDrivenFlag): args.append(menuDrivenFlag) #host = str(input("Enter your host: ")) #args.append('--host') #args.append(host) #user = readValuefromAppConfig("app.server.user") user = str(input("Enter your user [root]: ")) if (len(str(user)) == 0): user = "******" args.append('-u') args.append(user) hostsConfig = readValuefromAppConfig("app.manager.hosts") args.append('--id') hostsConfig = getHostConfiguration() args = str(args) args = args.replace('[', '').replace("'", "").replace("]", '').replace(',', '').strip() args = args + ' ' + str(hostsConfig) logger.debug('Arguments :' + args) if (config_get_cluster_airgap): execute_ssh_server_manager_install(hostsConfig, user) #os.system('python3 scripts/servers_manager_scriptbuilder.py '+args) ## Execution script flow diverted to this file hence major changes required and others scripts will going to distrub
def dataPuREST(resource, resourceName, zone, partition, maxInstancesPerMachine, backUpRequired): logger.info("dataPuREST()") try: ''' global slaProperties slaProperties = str(input(Fore.YELLOW+"Enter pu.autogenerated-instance-sla value [true] :"+Fore.RESET)) if(len(str(slaProperties))==0): slaProperties="true" logger.info("slaProperties :"+str(slaProperties)) global tieredCriteriaConfigFilePath tieredCriteriaConfigFilePath = str(readValuefromAppConfig("app.tieredstorage.criteria.filepath")).replace('"','') tieredCriteriaConfigFilePathInput = str(input(Fore.YELLOW+"Enter tieredCriteriaConfig.filePath ["+str(tieredCriteriaConfigFilePath)+"]: "+Fore.RESET)) if(len(str(tieredCriteriaConfigFilePathInput))>0): tieredCriteriaConfigFilePath = tieredCriteriaConfigFilePathInput while(len(str(tieredCriteriaConfigFilePath))==0): tieredCriteriaConfigFilePath = str(input(Fore.YELLOW+"Enter tieredCriteriaConfig.filePath : "+Fore.RESET)) logger.info("filePath :"+str(tieredCriteriaConfigFilePath)) set_value_in_property_file('app.tieredstorage.criteria.filepath',str(tieredCriteriaConfigFilePath)) global tieredCriteriaConfigFilePathTarget tieredCriteriaConfigFilePathTarget = str(readValuefromAppConfig("app.tieredstorage.criteria.filepath.target")).replace('"','') tieredCriteriaConfigFilePathTargetInput = str(input(Fore.YELLOW+"Enter tieredCriteriaConfig.filePath.target ["+str(tieredCriteriaConfigFilePathTarget)+"]: "+Fore.RESET)) if(len(str(tieredCriteriaConfigFilePathTargetInput))>0): tieredCriteriaConfigFilePathTarget = tieredCriteriaConfigFilePathTargetInput while(len(str(tieredCriteriaConfigFilePathTarget))==0): tieredCriteriaConfigFilePathTarget = str(input(Fore.YELLOW+"Enter tieredCriteriaConfig.filePath.target : "+Fore.RESET)) logger.info("filePath.target :"+str(tieredCriteriaConfigFilePathTarget)) set_value_in_property_file('app.tieredstorage.criteria.filepath.target',str(tieredCriteriaConfigFilePathTarget)) ''' global spacePropertyConfigFilePath spacePropertyConfigFilePath = str( readValuefromAppConfig("app.space.property.filePath")).replace( '"', '') logger.info("app.space.property.filePath :" + str(spacePropertyConfigFilePath)) spacePropertyConfigFilePathInput = str( input(Fore.YELLOW + "Enter space.property.filePath [" + str(spacePropertyConfigFilePath) + "]: " + Fore.RESET)) if (len(str(spacePropertyConfigFilePathInput)) > 0): spacePropertyConfigFilePath = spacePropertyConfigFilePathInput while (len(str(spacePropertyConfigFilePath)) == 0): spacePropertyConfigFilePath = str( input(Fore.YELLOW + "Enter space.property.filePath : " + Fore.RESET)) logger.info("spacePropertyConfigFilePath :" + str(spacePropertyConfigFilePath)) set_value_in_property_file('app.space.property.filePath', str(spacePropertyConfigFilePath)) global spacePropertyConfigFilePathTarget spacePropertyConfigFilePathTarget = str( readValuefromAppConfig( "app.space.property.filePath.target")).replace('"', '') logger.info("app.space.property.filePath.target :" + str(spacePropertyConfigFilePathTarget)) spacePropertyConfigFilePathTargetInput = str( input(Fore.YELLOW + "Enter space.property.filePath.target [" + str(spacePropertyConfigFilePathTarget) + "]: " + Fore.RESET)) if (len(str(spacePropertyConfigFilePathTargetInput)) > 0): spacePropertyConfigFilePathTarget = spacePropertyConfigFilePathTargetInput while (len(str(spacePropertyConfigFilePathTarget)) == 0): spacePropertyConfigFilePathTarget = str( input(Fore.YELLOW + "Enter space.property.filePath.target : " + Fore.RESET)) logger.info("spacePropertyConfigFilePathTarget :" + str(spacePropertyConfigFilePathTarget)) set_value_in_property_file('app.space.property.filePath.target', str(spacePropertyConfigFilePathTarget)) global spaceNameCfg spaceNameCfg = str( input(Fore.YELLOW + "Enter space name to set space.name : " + Fore.RESET)) while (len(str(spaceNameCfg)) == 0): spaceNameCfg = str( input(Fore.YELLOW + "Enter space name to set space.name : " + Fore.RESET)) logger.info("space.name :" + str(spaceNameCfg)) data = { "resource": "" + resource + "", "topology": { "schema": "partitioned", "partitions": int(partition), "backupsPerPartition": int(backUpRequired) }, "name": "" + resourceName + "", "sla": { "maxInstancesPerMachine": int(maxInstancesPerMachine), "zones": ["" + zone + ""], "maxInstancesPerVM": 0 }, "contextProperties": { #"pu.autogenerated-instance-sla" :""+slaProperties+"", #"tieredCriteriaConfig.filePath" : ""+tieredCriteriaConfigFilePathTarget+"", "space.propertyFilePath": "" + spacePropertyConfigFilePathTarget + "", "space.name": "" + spaceNameCfg + "" } } return data except Exception as e: handleException(e)