def setup_config(cls, use_file=False, argv=None): """Register CLI options & parse config file.""" if argv is None: argv = sys.argv[1:] try: syntribos.config.register_opts() if use_file: CONF(argv, default_config_files=[ENV.get_default_conf_file()]) else: CONF(argv, default_config_files=[]) except Exception as exc: syntribos.config.handle_config_exception(exc)
def setup_config(cls, use_file=False, argv=None): """Register CLI options & parse config file.""" if argv is None: argv = sys.argv[1:] try: syntribos.config.register_opts() if use_file: # Parsing the args first in case a custom_install_root # was specified. CONF(argv, default_config_files=[]) CONF(argv, default_config_files=[ENV.get_default_conf_file()]) else: CONF(argv, default_config_files=[]) except Exception as exc: syntribos.config.handle_config_exception(exc) if cls.worker: raise exc else: sys.exit(1)