def start(self, env): import params env.set_params(params) flume(action='config') flume(action='start')
def start(self, env): import params env.set_params(params) self.configure(env) flume(action='start')
def status(self, env): import params env.set_params(params) flume(action='status') """
def stop(self, env, upgrade_type=None): import params env.set_params(params) flume(action='stop') if upgrade_type is not None and params.upgrade_direction == Direction.UPGRADE: flume_upgrade.post_stop_backup()
def start(self, env, rolling_restart=False): import params env.set_params(params) self.configure(env) flume(action='start') Links(params.new_flume_config_path, params.flume_config_path) Links(params.new_flume_log_path, params.flume_log_path)
def stop(self, env, rolling_restart=False): import params env.set_params(params) flume(action='stop') # only backup data on upgrade if rolling_restart and params.upgrade_direction == Direction.UPGRADE: flume_upgrade.post_stop_backup()
def service_check(self, env): import params env.set_params(params) if params.security_enabled: principal_replaced = params.http_principal.replace("_HOST", params.hostname) Execute(format("{kinit_path_local} -kt {http_keytab} {principal_replaced}"), user=params.smoke_user) flume(action='status')
def service_check(self, env): import params env.set_params(params) if params.security_enabled: principal_replaced = params.http_principal.replace( "_HOST", params.hostname) Execute(format( "{kinit_path_local} -kt {http_keytab} {principal_replaced}"), user=params.smoke_user) flume(action='status')
def creategeom(self,data,path): ''' Creates the geometry for OSU flume Arguments ----------- data: all the JSON data ''' # Number of flume points numflumepoints = 9 # Provide the coordinates in a numpy array nums = np.zeros(2*(numflumepoints)) nums[0] = -2.085 nums[1] = 0.0 nums[2] = 14.2748 nums[3] = 0.0 nums[4] = 14.2748 nums[5] = 0.1524 nums[6] = 17.9324 nums[7] = 0.1524 nums[8] = 28.9052 nums[9] = 1.15 nums[10] = 43.5356 nums[11] = 1.7526 nums[12] = 80.116 nums[13] = 1.7526 nums[14] = 80.116 nums[15] = 4.572 nums[16] = -2.085 nums[17] = 4.572 # Create temporary file filename = 'FlumeData.txt' if os.path.exists(filename): os.remove(filename) f = open(filename, "a") for ii in range(int(numflumepoints)): f.write(str(nums[2*ii]) + ',' + str(nums[2*ii+1]) + '\n' ) f.close() # Add breadth of the flume breadth = 3.70 # Create the STL file and get extreme file (needed for blockmesh and building) flumeobj = flume() extreme = flumeobj.generateflume(breadth,path) # Write extreme values and building data to temporary file for later usage flumeobj.extremedata(extreme,breadth) return 0
def creategeom(self, data, path): ''' Creates the geometry for user flume Arguments ----------- data: all the JSON data ''' # Create a utilities object hydroutil = hydroUtils() # Read the flume segments flumesegs = ', '.join( hydroutil.extract_element_from_json(data, ["Events", "FlumeSegments"])) # Get the number of flume segments numflumesegs = ', '.join( hydroutil.extract_element_from_json( data, ["Events", "NumFlumeSegments"])) # Replace the comma by spaces in segments list flumesegs = flumesegs.replace(',', ' ') # Convert the flume segment to list of floats nums = [float(n) for n in flumesegs.split()] # Remove the first item nums.pop(0) # Create temporary file filename = 'FlumeData.txt' if os.path.exists(filename): os.remove(filename) f = open(filename, "a") for ii in range(int(numflumesegs)): f.write(str(nums[2 * ii]) + ',' + str(nums[2 * ii + 1]) + '\n') f.close() # Get the breadth breadthval = ''.join( hydroutil.extract_element_from_json(data, ["Events", "FlumeBreadth"])) breadth = float(breadthval) # Create the STL file and get extreme file (needed for blockmesh and building) flumeobj = flume() extreme = flumeobj.generateflume(breadth, path) # Write extreme values and building data to temporary file for later usage flumeobj.extremedata(extreme, breadth) return 0
def configure(self, env): import params env.set_params(params) flume(action='config')
def start(self, env, rolling_restart=False): import params env.set_params(params) self.configure(env) flume(action='start')
def stop(self, env): import params env.set_params(params) flume(action='stop')
def stop(self, env, rolling_restart=False): import params env.set_params(params) flume(action='stop') if rolling_restart: flume_upgrade.post_stop_backup()
def start(self, env, upgrade_type=None): import params env.set_params(params) self.configure(env) flume(action='start')
def stop(self, env, upgrade_type=None): import params env.set_params(params) flume(action='stop')