From f8b5776ff57500dc03a6b82ca70191be5e7a5b17 Mon Sep 17 00:00:00 2001 From: Tim Bielawa Date: Thu, 25 Aug 2016 07:53:24 -0700 Subject: Fix PEP8 in oo_config.py --- utils/src/ooinstall/oo_config.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'utils') diff --git a/utils/src/ooinstall/oo_config.py b/utils/src/ooinstall/oo_config.py index 0e855f437..b9f0cc65c 100644 --- a/utils/src/ooinstall/oo_config.py +++ b/utils/src/ooinstall/oo_config.py @@ -18,7 +18,7 @@ CONFIG_PERSIST_SETTINGS = [ 'version', 'variant', 'variant_version', - ] +] DEPLOYMENT_VARIABLES_BLACKLIST = [ 'hosts', @@ -28,6 +28,7 @@ DEPLOYMENT_VARIABLES_BLACKLIST = [ DEFAULT_REQUIRED_FACTS = ['ip', 'public_ip', 'hostname', 'public_hostname'] PRECONFIGURED_REQUIRED_FACTS = ['hostname', 'public_hostname'] + def print_read_config_error(error, path='the configuration file'): message = """ Error loading config. {}. @@ -103,7 +104,6 @@ class Host(object): def is_storage(self): return 'storage' in self.roles - def is_etcd_member(self, all_hosts): """ Will this host be a member of a standalone etcd cluster. """ if not self.is_master(): @@ -189,7 +189,7 @@ class OOConfig(object): with open(self.config_path, 'r') as cfgfile: loaded_config = yaml.safe_load(cfgfile.read()) - if not 'version' in loaded_config: + if 'version' not in loaded_config: print_read_config_error('Legacy configuration file found', self.config_path) sys.exit(0) @@ -242,7 +242,6 @@ class OOConfig(object): for name, variables in role_list.iteritems(): self.deployment.roles.update({name: Role(name, variables)}) - except IOError, ferr: raise OOConfigFileError('Cannot open config file "{}": {}'.format(ferr.filename, ferr.strerror)) @@ -251,7 +250,6 @@ class OOConfig(object): 'Config file "{}" is not a valid YAML document'.format(self.config_path)) installer_log.debug("Parsed the config file") - def _upgrade_v1_config(self, config): new_config_data = {} new_config_data['deployment'] = {} @@ -396,7 +394,6 @@ class OOConfig(object): print "Error persisting settings: {}".format(e) sys.exit(0) - return p_settings def yaml(self): -- cgit v1.2.3