Skip to content

Commit

Permalink
add /usr/share/$project/*-dist.conf to the default config set
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Pádraig Brady authored and apevec committed Oct 11, 2013
1 parent eae8b31 commit e67c68f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions oslo/config/cfg.py
Expand Up @@ -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))

Expand Down

0 comments on commit e67c68f

Please sign in to comment.