pass default_config_dirs variable for config initialization.
Currently default config files are being for initialization of CONF from
oslo_config. However default config dirs are not being passed as a
result watcher components (eg: decision-engine) are unable to load
files from default directories (eg: /etc/watcher/watcher.conf.d)
supported by oslo_config. This is a short-coming on watcher's side.
Also this forces user to have multiple config for each component.
Without this default set, oslo_config will search for conf with string
'python-watcher' in it, eg: /etc/python-watcher/.... Since there is a
because project=python-watcher a couple of lines below
This patch adds the option after evaluating using project as 'watcher'
which is similar to evaluation of default_config_files and also allows
it to be passed in as a function parameter.
Change-Id: I013f9d03978f8716847f8d1ee6888629faf5779b
(cherry picked from commit dce23d7eb4)
This commit is contained in:
@@ -21,12 +21,15 @@ from watcher.common import rpc
|
|||||||
from watcher import version
|
from watcher import version
|
||||||
|
|
||||||
|
|
||||||
def parse_args(argv, default_config_files=None):
|
def parse_args(argv, default_config_files=None, default_config_dirs=None):
|
||||||
default_config_files = (default_config_files or
|
default_config_files = (default_config_files or
|
||||||
cfg.find_config_files(project='watcher'))
|
cfg.find_config_files(project='watcher'))
|
||||||
|
default_config_dirs = (default_config_dirs or
|
||||||
|
cfg.find_config_dirs(project='watcher'))
|
||||||
rpc.set_defaults(control_exchange='watcher')
|
rpc.set_defaults(control_exchange='watcher')
|
||||||
cfg.CONF(argv[1:],
|
cfg.CONF(argv[1:],
|
||||||
project='python-watcher',
|
project='python-watcher',
|
||||||
version=version.version_info.release_string(),
|
version=version.version_info.release_string(),
|
||||||
|
default_config_dirs=default_config_dirs,
|
||||||
default_config_files=default_config_files)
|
default_config_files=default_config_files)
|
||||||
rpc.init(cfg.CONF)
|
rpc.init(cfg.CONF)
|
||||||
|
|||||||
Reference in New Issue
Block a user