From e67c68fe9bcc3db355d46a7ca3347fe4826becc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Mon, 11 Feb 2013 17:32:55 +0000 Subject: [PATCH] add /usr/share/$project/*-dist.conf to the default config set This will lookup /usr/share/$project/$project-dist.conf and /usr/share/$project/$prog-dist.conf in the correct precedence order by default. For example from command line utils which don't specify the --config-file option. Note if daemon init scripts explicitly specify a --config-file then they must specify all required. For reference the precedence order is that later --config-file options will override settings from previous ones. So when no --config-file option is specified, we insert the "dist" config file as the first to be parsed, and settings from there are overridden by any from /etc/$project/$project.conf and /etc/$prog.conf respectively. For completeness, note settings in configs from --config-dir take precedence over any of the --config-file settings above. --- oslo/config/cfg.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/oslo/config/cfg.py b/oslo/config/cfg.py index 4354886..4b3e25d 100644 --- a/oslo/config/cfg.py +++ b/oslo/config/cfg.py @@ -471,6 +471,10 @@ def find_config_files(project=None, prog=None, extension='.conf'): config_files = [] if project: + config_files.append(_search_dirs(['/usr/share/%s/' % project], + project, '-dist%s' % extension)) + config_files.append(_search_dirs(['/usr/share/%s/' % project], + prog, '-dist%s' % extension)) config_files.append(_search_dirs(cfg_dirs, project, extension)) config_files.append(_search_dirs(cfg_dirs, prog, extension))