X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fclient%2Fsfi.py;h=792c404f3312008c714b78eb38147dcb0ed0157b;hb=d07712ab8b6f9a4a88a3728ec7809796d27e4952;hp=28c7c1ade774b0b96abb3f2a0473463e60bbbefc;hpb=f95271c1f2649e1a66a07af67a73b85188d8d2e4;p=sfa.git 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