Guard against config_dirs not defined on ConfigOpts
Turned out that if the code extracts config_dirs value from ConfigOpts
objects before config files are parsed, then oslo.config will raise
NoSuchOptError exception.
This is not a usual mode of operation for the code, since main()
function of the process using it is expected to parse CLI and config
files before using it, it may nevertheless happen in some test code.
This patch guards against those exceptions, falling back to
/etc/neutron, as we already do when --config-dir is not specified.
Reviewed: https:/ /review. openstack. org/323428 /git.openstack. org/cgit/ openstack/ neutron/ commit/ ?id=a8da782051f c085fcb417c6d27 7a5e27586e2380
Committed: https:/
Submitter: Jenkins
Branch: master
commit a8da782051fc085 fcb417c6d277a5e 27586e2380
Author: Ihar Hrachyshka <email address hidden>
Date: Tue May 31 16:51:30 2016 +0200
Guard against config_dirs not defined on ConfigOpts
Turned out that if the code extracts config_dirs value from ConfigOpts
objects before config files are parsed, then oslo.config will raise
NoSuchOptError exception.
This is not a usual mode of operation for the code, since main()
function of the process using it is expected to parse CLI and config
files before using it, it may nevertheless happen in some test code.
This patch guards against those exceptions, falling back to
/etc/neutron, as we already do when --config-dir is not specified.
Change-Id: I00cf824baa8580 b7aa7ec4518a474 1e49c998364
Closes-Bug: #1587359