Fix exception in neutron-sanity-check

When the config options were all moved to neutron/conf
the neutron-sanity-check script was not updated.  Have
it use the registration methods directly.

Change-Id: Ie45ce0faa17ee4cfe8d2a1dce442b032efea0041
Closes-bug: #1769868
This commit is contained in:
Brian Haley
2018-06-13 18:21:14 +00:00
committed by Brian Haley
parent ebf1d3d804
commit db22f5bfa8
2 changed files with 15 additions and 10 deletions
+9 -9
View File
@@ -22,23 +22,23 @@ from neutron._i18n import _
from neutron.agent import dhcp_agent
from neutron.cmd.sanity import checks
from neutron.common import config
from neutron.conf.agent import securitygroups_rpc
from neutron.conf.db import l3_hamode_db
from neutron.conf.plugins.ml2 import config as ml2_conf
from neutron.conf.plugins.ml2.drivers import linuxbridge as lb_conf
from neutron.conf.plugins.ml2.drivers import ovs_conf
LOG = logging.getLogger(__name__)
def setup_conf():
cfg.CONF.import_group('AGENT', 'neutron.plugins.ml2.drivers.openvswitch.'
'agent.common.config')
cfg.CONF.import_group('OVS', 'neutron.plugins.ml2.drivers.openvswitch.'
'agent.common.config')
cfg.CONF.import_group('VXLAN', 'neutron.plugins.ml2.drivers.linuxbridge.'
'agent.common.config')
cfg.CONF.import_group('ml2', 'neutron.conf.plugins.ml2.config')
cfg.CONF.import_group('SECURITYGROUP', 'neutron.agent.securitygroups_rpc')
ovs_conf.register_ovs_agent_opts(cfg.CONF)
lb_conf.register_linuxbridge_opts(cfg.CONF)
ml2_conf.register_ml2_plugin_opts(cfg.CONF)
securitygroups_rpc.register_securitygroups_opts(cfg.CONF)
dhcp_agent.register_options(cfg.CONF)
cfg.CONF.register_opts(l3_hamode_db.L3_HA_OPTS)
l3_hamode_db.register_db_l3_hamode_opts(cfg.CONF)
class BoolOptCallback(cfg.BoolOpt):
+6 -1
View File
@@ -13,6 +13,9 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from oslo_config import cfg
from neutron.cmd import sanity_check
from neutron.tests import base
@@ -21,4 +24,6 @@ class TestSanityCheck(base.BaseTestCase):
def test_setup_conf(self):
# verify that configuration can be successfully imported
sanity_check.setup_conf()
with mock.patch.object(sanity_check.cfg, 'CONF',
return_value=cfg.ConfigOpts()):
sanity_check.setup_conf()