Add common neutron config options to status CLI tool

In neutron-status upgrade check tool config options from
core_common_config_opts group are registered as some of them
are necessary by e.g. fwaas check proposed in [1].

[1] https://review.openstack.org/637203

Change-Id: I93c97f5458c9d120e5d76508c282f57d8bfea120
This commit is contained in:
Slawek Kaplonski 2019-02-15 16:27:00 +01:00
parent 3b8d3b6f1b
commit ade5d52241
1 changed files with 15 additions and 1 deletions

View File

@ -17,6 +17,8 @@ from oslo_config import cfg
from oslo_log import log as logging
from oslo_upgradecheck import upgradecheck
from neutron.conf import common as neutron_conf_base
CHECKS_ENTRYPOINTS = 'neutron.status.upgrade.checks'
LOG = logging.getLogger(__name__)
@ -40,6 +42,17 @@ def load_checks():
return tuple(checks)
def setup_conf(conf=cfg.CONF):
"""Setup the cfg for the status check utility.
Use separate setup_conf for the utility because there are many options
from the main config that do not apply during checks.
"""
neutron_conf_base.register_core_common_config_opts(conf)
return conf
class Checker(upgradecheck.UpgradeCommands):
"""Various upgrade checks should be added as separate methods in this class
@ -62,5 +75,6 @@ class Checker(upgradecheck.UpgradeCommands):
def main():
conf = setup_conf()
return upgradecheck.main(
cfg.CONF, project='neutron', upgrade_command=Checker())
conf, project='neutron', upgrade_command=Checker())