From bc1d0034458ee5e8b75c0747dfc1cf0fe6a133fc Mon Sep 17 00:00:00 2001 From: fredlef Date: Jan 05 2022 16:36:43 +0000 Subject: config file on the command line should replace the system config Koji config files are additive. That makes sense when loading the system config, followed by /etc/koji.d/*. But when a user config is provided on the command line, it should be loaded instead of the system config and not in addition to it. Otherwise the system config can never be fully overridden. --- diff --git a/koji/__init__.py b/koji/__init__.py index 76e4ec1..da2f78d 100644 --- a/koji/__init__.py +++ b/koji/__init__.py @@ -1974,12 +1974,7 @@ def read_config(profile_name, user_config=None): result = config_defaults.copy() # note: later config files override earlier ones - - # /etc/koji.conf.d - configs = ['/etc/koji.conf.d'] - - # /etc/koji.conf - configs.append('/etc/koji.conf') + configs = [] # User specific configuration if user_config: @@ -1987,6 +1982,12 @@ def read_config(profile_name, user_config=None): # The existence will be checked configs.append((os.path.expanduser(user_config), True)) else: + # /etc/koji.conf.d + configs.append('/etc/koji.conf.d') + + # /etc/koji.conf + configs.append('/etc/koji.conf') + # User config dir configs.append(os.path.expanduser("~/.koji/config.d")) # User config file