Merge "Remove deprecated NVP options"
This commit is contained in:
commit
512bdfa713
@ -1,21 +1,3 @@
|
|||||||
# #############################################################
|
|
||||||
# WARNINGS: The following deprecations have been made in the
|
|
||||||
# Havana release. Support for the options below will be removed
|
|
||||||
# in Ixxx.
|
|
||||||
#
|
|
||||||
# Section: [DEFAULT], Option: 'metadata_dhcp_host_route'
|
|
||||||
# Remarks: Use 'enable_isolated_metadata' in dhcp_agent.ini.
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# Section: [cluster:name], Option: 'nvp_controller_connection'
|
|
||||||
# Remarks: The configuration will allow the specification of
|
|
||||||
# a single cluster, therefore [cluster:name] is no
|
|
||||||
# longer used. Use 'nvp_*', options, 'req_timeout',
|
|
||||||
# 'retries', etc. as indicated in the DEFAULT section.
|
|
||||||
# Support for multiple clusters will be added through
|
|
||||||
# an API extension.
|
|
||||||
# ##############################################################
|
|
||||||
|
|
||||||
[DEFAULT]
|
[DEFAULT]
|
||||||
# User name for NVP controller
|
# User name for NVP controller
|
||||||
# nvp_user = admin
|
# nvp_user = admin
|
||||||
|
@ -57,7 +57,7 @@ from neutron.extensions import providernet as pnet
|
|||||||
from neutron.extensions import securitygroup as ext_sg
|
from neutron.extensions import securitygroup as ext_sg
|
||||||
from neutron.openstack.common import excutils
|
from neutron.openstack.common import excutils
|
||||||
from neutron.plugins.common import constants as plugin_const
|
from neutron.plugins.common import constants as plugin_const
|
||||||
from neutron.plugins.nicira.common import config
|
from neutron.plugins.nicira.common import config # noqa
|
||||||
from neutron.plugins.nicira.common import exceptions as nvp_exc
|
from neutron.plugins.nicira.common import exceptions as nvp_exc
|
||||||
from neutron.plugins.nicira.common import securitygroups as nvp_sec
|
from neutron.plugins.nicira.common import securitygroups as nvp_sec
|
||||||
from neutron.plugins.nicira.common import sync
|
from neutron.plugins.nicira.common import sync
|
||||||
@ -97,11 +97,6 @@ class NetworkTypes:
|
|||||||
|
|
||||||
def create_nvp_cluster(cluster_opts, concurrent_connections,
|
def create_nvp_cluster(cluster_opts, concurrent_connections,
|
||||||
nvp_gen_timeout):
|
nvp_gen_timeout):
|
||||||
# NOTE(armando-migliaccio): remove this block once we no longer
|
|
||||||
# want to support deprecated options in the nvp config file
|
|
||||||
# ### BEGIN
|
|
||||||
config.register_deprecated(cfg.CONF)
|
|
||||||
# ### END
|
|
||||||
cluster = nvp_cluster.NVPCluster(**cluster_opts)
|
cluster = nvp_cluster.NVPCluster(**cluster_opts)
|
||||||
api_providers = [ctrl.split(':') + [True]
|
api_providers = [ctrl.split(':') + [True]
|
||||||
for ctrl in cluster.nvp_controllers]
|
for ctrl in cluster.nvp_controllers]
|
||||||
|
@ -162,32 +162,3 @@ cfg.CONF.register_opts(cluster_opts)
|
|||||||
cfg.CONF.register_opts(nvp_opts, "NVP")
|
cfg.CONF.register_opts(nvp_opts, "NVP")
|
||||||
cfg.CONF.register_opts(sync_opts, "NVP_SYNC")
|
cfg.CONF.register_opts(sync_opts, "NVP_SYNC")
|
||||||
cfg.CONF.register_opts(vcns_opts, group="vcns")
|
cfg.CONF.register_opts(vcns_opts, group="vcns")
|
||||||
# NOTE(armando-migliaccio): keep the following code until we support
|
|
||||||
# NVP configuration files in older format (Grizzly or older).
|
|
||||||
# ### BEGIN
|
|
||||||
controller_depr = cfg.MultiStrOpt('nvp_controller_connection',
|
|
||||||
help=_("Describes a connection to a single "
|
|
||||||
"controller. A different connection "
|
|
||||||
"for each controller in the cluster "
|
|
||||||
"can be specified; there must be at "
|
|
||||||
"least one connection per cluster."))
|
|
||||||
|
|
||||||
host_route_depr = cfg.BoolOpt('metadata_dhcp_host_route', default=None)
|
|
||||||
|
|
||||||
|
|
||||||
def register_deprecated(conf):
|
|
||||||
conf.register_opts([host_route_depr])
|
|
||||||
multi_parser = cfg.MultiConfigParser()
|
|
||||||
read_ok = multi_parser.read(conf.config_file)
|
|
||||||
if len(read_ok) != len(conf.config_file):
|
|
||||||
raise cfg.Error(_("Some config files were not parsed properly"))
|
|
||||||
|
|
||||||
for parsed_file in multi_parser.parsed:
|
|
||||||
for section in parsed_file.keys():
|
|
||||||
if not section.lower().startswith("cluster:"):
|
|
||||||
continue
|
|
||||||
|
|
||||||
section = 'CLUSTER:' + section.split(':', 1)[1]
|
|
||||||
if section not in conf:
|
|
||||||
conf.register_opts(cluster_opts + [controller_depr], section)
|
|
||||||
# ### END
|
|
||||||
|
@ -79,16 +79,6 @@ class NVPCluster(object):
|
|||||||
elif options.get(arg) is not None:
|
elif options.get(arg) is not None:
|
||||||
# Process deprecated attributes only if specified
|
# Process deprecated attributes only if specified
|
||||||
self._deprecated_attributes[arg] = options.get(arg)
|
self._deprecated_attributes[arg] = options.get(arg)
|
||||||
if arg.startswith("CLUSTER:"):
|
|
||||||
cluster_section = cfg.CONF.get(arg)
|
|
||||||
for option in cluster_section:
|
|
||||||
v = cluster_section.get(option)
|
|
||||||
if option not in DEPRECATED_ATTRIBUTES:
|
|
||||||
# option may be in dict, but with None value
|
|
||||||
setattr(self, option, options.get(option) or v)
|
|
||||||
self._process_attribute(option)
|
|
||||||
else:
|
|
||||||
self._deprecated_attributes[option] = v
|
|
||||||
|
|
||||||
def _process_attribute(self, attribute):
|
def _process_attribute(self, attribute):
|
||||||
# Process the attribute only if it's not empty!
|
# Process the attribute only if it's not empty!
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
[DEFAULT]
|
|
||||||
metadata_dhcp_host_route = False
|
|
||||||
|
|
||||||
[cluster:fake]
|
|
||||||
default_tz_uuid = fake_tz_uuid
|
|
||||||
nova_zone_id = whatever
|
|
||||||
nvp_cluster_uuid = fake_cluster_uuid
|
|
||||||
nvp_controller_connection=fake_1:443:foo:bar:4:3:2:1
|
|
||||||
nvp_controller_connection=fake_2:443:foo:bar:4:3:2:1
|
|
||||||
default_l3_gw_service_uuid = whatever
|
|
||||||
default_l2_gw_service_uuid = whatever
|
|
@ -35,7 +35,6 @@ BASE_CONF_PATH = get_fake_conf('neutron.conf.test')
|
|||||||
NVP_BASE_CONF_PATH = get_fake_conf('neutron.conf.test')
|
NVP_BASE_CONF_PATH = get_fake_conf('neutron.conf.test')
|
||||||
NVP_INI_PATH = get_fake_conf('nvp.ini.basic.test')
|
NVP_INI_PATH = get_fake_conf('nvp.ini.basic.test')
|
||||||
NVP_INI_FULL_PATH = get_fake_conf('nvp.ini.full.test')
|
NVP_INI_FULL_PATH = get_fake_conf('nvp.ini.full.test')
|
||||||
NVP_INI_DEPR_PATH = get_fake_conf('nvp.ini.grizzly.test')
|
|
||||||
NVP_INI_AGENTLESS_PATH = get_fake_conf('nvp.ini.agentless.test')
|
NVP_INI_AGENTLESS_PATH = get_fake_conf('nvp.ini.agentless.test')
|
||||||
|
|
||||||
|
|
||||||
@ -173,36 +172,3 @@ class ConfigurationTest(testtools.TestCase):
|
|||||||
plugin.supported_extension_aliases)
|
plugin.supported_extension_aliases)
|
||||||
self.assertIn('dhcp_agent_scheduler',
|
self.assertIn('dhcp_agent_scheduler',
|
||||||
plugin.supported_extension_aliases)
|
plugin.supported_extension_aliases)
|
||||||
|
|
||||||
|
|
||||||
class OldConfigurationTest(testtools.TestCase):
|
|
||||||
|
|
||||||
def setUp(self):
|
|
||||||
super(OldConfigurationTest, self).setUp()
|
|
||||||
self.addCleanup(cfg.CONF.reset)
|
|
||||||
self.useFixture(fixtures.MonkeyPatch(
|
|
||||||
'neutron.manager.NeutronManager._instance',
|
|
||||||
None))
|
|
||||||
# Avoid runs of the synchronizer looping call
|
|
||||||
patch_sync = mock.patch.object(sync, '_start_loopingcall')
|
|
||||||
patch_sync.start()
|
|
||||||
self.addCleanup(patch_sync.stop)
|
|
||||||
|
|
||||||
def _assert_required_options(self, cluster):
|
|
||||||
self.assertEqual(cluster.nvp_controllers, ['fake_1:443', 'fake_2:443'])
|
|
||||||
self.assertEqual(cluster.default_tz_uuid, 'fake_tz_uuid')
|
|
||||||
self.assertEqual(cluster.nvp_user, 'foo')
|
|
||||||
self.assertEqual(cluster.nvp_password, 'bar')
|
|
||||||
|
|
||||||
def test_load_plugin_with_deprecated_options(self):
|
|
||||||
q_config.parse(['--config-file', BASE_CONF_PATH,
|
|
||||||
'--config-file', NVP_INI_DEPR_PATH])
|
|
||||||
cfg.CONF.set_override('core_plugin', PLUGIN_NAME)
|
|
||||||
plugin = NeutronManager().get_plugin()
|
|
||||||
cluster = plugin.cluster
|
|
||||||
self._assert_required_options(cluster)
|
|
||||||
# Verify nvp_controller_connection has been fully parsed
|
|
||||||
self.assertEqual(4, cluster.req_timeout)
|
|
||||||
self.assertEqual(3, cluster.http_timeout)
|
|
||||||
self.assertEqual(2, cluster.retries)
|
|
||||||
self.assertEqual(1, cluster.redirects)
|
|
||||||
|
Loading…
Reference in New Issue
Block a user