From d07712ab8b6f9a4a88a3728ec7809796d27e4952 Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Tue, 17 Jul 2012 22:42:19 -0400 Subject: [PATCH] fix read_config() --- sfa/client/sfi.py | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/sfa/client/sfi.py b/sfa/client/sfi.py index 28c7c1ad..792c404f 100644 --- a/sfa/client/sfi.py +++ b/sfa/client/sfi.py @@ -549,19 +549,21 @@ class Sfi: def read_config(self): config_file = os.path.join(self.options.sfi_dir,"sfi_config") try: - config = Config (config_file) + if Config.is_ini(config_file): + config = Config (config_file) + else: + # try upgrading from shell config format + self.upgrade_config(config_file) + config = Config(config_file) + except: - try: - # try upgrading from old config format - self.upgrade_config(config_file) - except: - self.logger.critical("Failed to read configuration file %s"%config_file) - self.logger.info("Make sure to remove the export clauses and to add quotes") - if self.options.verbose==0: - self.logger.info("Re-run with -v for more details") - else: - self.logger.log_exc("Could not read config file %s"%config_file) - sys.exit(1) + self.logger.critical("Failed to read configuration file %s"%config_file) + self.logger.info("Make sure to remove the export clauses and to add quotes") + if self.options.verbose==0: + self.logger.info("Re-run with -v for more details") + else: + self.logger.log_exc("Could not read config file %s"%config_file) + sys.exit(1) errors = 0 # Set SliceMgr URL -- 2.43.0