Changeset - 04c8edacc3a1
[Not reviewed]
default
0 1 0
Mads Kiilerich (mads) - 5 years ago 2020-12-26 18:14:26
mads@kiilerich.com
cli: in runtime_wrapper for config file handling, don't return unused command handler value

Return values are not used - we should use sys.exit or similar to set command
return codes.
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
kallithea/bin/kallithea_cli_base.py
Show inline comments
 
@@ -73,16 +73,16 @@ def register_command(needs_config_file=F
 
                path_to_ini_file = os.path.realpath(config_file)
 
                config = paste.deploy.appconfig('config:' + path_to_ini_file)
 
                cp = configparser.ConfigParser(strict=False)
 
                cp.read_string(read_config(path_to_ini_file, strip_section_prefix=annotated.__name__))
 
                logging.config.fileConfig(cp,
 
                    {'__file__': path_to_ini_file, 'here': os.path.dirname(path_to_ini_file)})
 
                if config_file_initialize_app:
 
                    if needs_config_file:  # special case for db creation: also call annotated function (with config parameter) *before* app initialization
 
                        annotated(*args, config=config, **kwargs)
 
                    kallithea.config.application.make_app(config.global_conf, **config.local_conf)
 
                else:
 
                    kallithea.CONFIG = dict(config)  # config is a dict subclass
 
                return annotated(*args, **kwargs)
 
                annotated(*args, **kwargs)
 
            return cli_command(runtime_wrapper)
 
        return annotator
 
    return cli_command
0 comments (0 inline, 0 general)