def __generate_workload_config(self, extraneous_config): # Read base workload properties into a dict if we haven't already if self.__base_workload_props is None: props = Properties() with open(self.workload_path) as wf: props.load(wf) self.__base_workload_props = props.getPropertyDict() if extraneous_config is None: extraneous_config = {} # Merge base workload properties with extraneous options workload_config = dict(self.__base_workload_props) workload_config.update(extraneous_config) # Merge and return the workload config dict return workload_config
import os from pyjavaproperties import Properties CURRENT_DIR = os.getcwd() ENV_FILE = '.env' # Set env file location env_file_path = CURRENT_DIR + '/' + ENV_FILE # Instance of Properties Object envProperties = Properties() # Load properties from .env file envProperties.load(open(env_file_path)) # Set dictionary of properties env = envProperties.getPropertyDict()