def get_current_config(): ensure_bombardier_config_dir() if os.path.isfile(CONFIG_FILE): current_config = yaml_load(open(CONFIG_FILE).read()) if type(current_config) == type({}): return current_config else: return None
def get_current_configs(): ensure_bombardier_config_dir() server_conf = {} client_conf = {} if os.path.isfile(SERVER_CONFIG_FILE): test_server_conf = yaml.load(open(SERVER_CONFIG_FILE).read()) if type(test_server_conf) == type({}): server_conf = test_server_conf if os.path.isfile(CLIENT_CONFIG_FILE): test_client_conf = yaml.load(open(CLIENT_CONFIG_FILE).read()) if type(test_client_conf) == type({}): client_conf = test_client_conf return server_conf, client_conf
def write_config(self, option, value): ensure_bombardier_config_dir() self.global_config[option] = value open(SERVER_CONFIG_FILE, 'w').write(yaml.dump(self.global_config)) os.system("chgrp %s %s 2> /dev/null" % (self.default_group, SERVER_CONFIG_FILE)) os.system("chmod 660 %s 2> /dev/null" % (SERVER_CONFIG_FILE))