diff --git a/moonraker/app.py b/moonraker/app.py index e181c3d..c49d34a 100644 --- a/moonraker/app.py +++ b/moonraker/app.py @@ -129,7 +129,7 @@ class MoonrakerApp: self.get_handler_delegate = self.app.get_handler_delegate # Register handlers - logfile = config['cmd_args'].get('logfile') + logfile = config['system_args'].get('logfile') self.register_static_file_handler("moonraker.log", logfile) self.auth.register_handlers(self) diff --git a/moonraker/confighelper.py b/moonraker/confighelper.py index 98bf416..0578887 100644 --- a/moonraker/confighelper.py +++ b/moonraker/confighelper.py @@ -70,9 +70,9 @@ class ConfigHelper: return self._get_item( self.config[self.section].getfloat, option, default) -def get_configuration(server, cmd_line_args): +def get_configuration(server, system_args): cfg_file_path = os.path.normpath(os.path.expanduser( - cmd_line_args.configfile)) + system_args.configfile)) if not os.path.isfile(cfg_file_path): raise ConfigError(f"Configuration File Not Found: '{cfg_file_path}''") config = configparser.ConfigParser(interpolation=None) @@ -89,5 +89,5 @@ def get_configuration(server, cmd_line_args): if server_cfg.get('enable_debug_logging', True): logging.getLogger().setLevel(logging.DEBUG) - config['cmd_args'] = {'logfile': cmd_line_args.logfile} + config['system_args'] = {'logfile': system_args.logfile} return ConfigHelper(server, config, 'server') diff --git a/moonraker/moonraker.py b/moonraker/moonraker.py index ee62c0f..7b55cdf 100644 --- a/moonraker/moonraker.py +++ b/moonraker/moonraker.py @@ -101,7 +101,7 @@ class Server: # check for optional plugins opt_sections = set([s.split()[0] for s in config.sections()]) - \ - set(['server', 'authorization', 'cmd_args']) + set(['server', 'authorization', 'system_args']) for section in opt_sections: self.load_plugin(config, section, None) @@ -550,11 +550,11 @@ def main(): parser.add_argument( "-l", "--logfile", default="/tmp/moonraker.log", metavar='', help="log file name and location") - cmd_line_args = parser.parse_args() + system_args = parser.parse_args() # Setup Logging - log_file = os.path.normpath(os.path.expanduser(cmd_line_args.logfile)) - cmd_line_args.logfile = log_file + log_file = os.path.normpath(os.path.expanduser(system_args.logfile)) + system_args.logfile = log_file ql = utils.setup_logging(log_file) if sys.version_info < (3, 7): @@ -570,7 +570,7 @@ def main(): estatus = 0 while True: try: - server = Server(cmd_line_args) + server = Server(system_args) except Exception: logging.exception("Moonraker Error") estatus = 1