]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Remove deprecated NVP options
authorarmando-migliaccio <amigliaccio@nicira.com>
Fri, 27 Sep 2013 16:27:50 +0000 (09:27 -0700)
committerarmando-migliaccio <amigliaccio@nicira.com>
Fri, 27 Sep 2013 21:33:08 +0000 (14:33 -0700)
In Havana, NVP configuration was simplified;
in the process a few options that existed
in Grizzly or older were deprecated. This
change removes those options from the Icehouse
tree.

Fixes bug #1221840

Change-Id: Id83a339c88ec2477718a350b6ac1678ccba01509

etc/neutron/plugins/nicira/nvp.ini
neutron/plugins/nicira/NeutronPlugin.py
neutron/plugins/nicira/common/config.py
neutron/plugins/nicira/nvp_cluster.py
neutron/tests/unit/nicira/etc/nvp.ini.grizzly.test [deleted file]
neutron/tests/unit/nicira/test_nvpopts.py

index 418d873cbf8f3721fefd3ad36cead760f5294faf..631062b7a3d4aedab877bb3786b18726ee60f643 100644 (file)
@@ -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]
 # User name for NVP controller
 # nvp_user = admin
index ae052a66db4bcbc0154487507675402d2d124089..b77c59cdec81f1f19b02255709452e67343c09c2 100644 (file)
@@ -57,7 +57,7 @@ from neutron.extensions import providernet as pnet
 from neutron.extensions import securitygroup as ext_sg
 from neutron.openstack.common import excutils
 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 securitygroups as nvp_sec
 from neutron.plugins.nicira.common import sync
@@ -97,11 +97,6 @@ class NetworkTypes:
 
 def create_nvp_cluster(cluster_opts, concurrent_connections,
                        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)
     api_providers = [ctrl.split(':') + [True]
                      for ctrl in cluster.nvp_controllers]
index 7fc0dae8f8ff6d4b4b531f313024d25005275c60..be4ffb32e49b17a16548324a5da34507f16c9ba1 100644 (file)
@@ -157,32 +157,3 @@ cfg.CONF.register_opts(cluster_opts)
 cfg.CONF.register_opts(nvp_opts, "NVP")
 cfg.CONF.register_opts(sync_opts, "NVP_SYNC")
 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
index 9166c88319f9952185b5b3a9dcdb1cc32338bc0f..7d570d97476fa11ca4f5d7a782b6d57955cd1b6e 100644 (file)
@@ -79,16 +79,6 @@ class NVPCluster(object):
             elif options.get(arg) is not None:
                 # Process deprecated attributes only if specified
                 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):
         # Process the attribute only if it's not empty!
diff --git a/neutron/tests/unit/nicira/etc/nvp.ini.grizzly.test b/neutron/tests/unit/nicira/etc/nvp.ini.grizzly.test
deleted file mode 100644 (file)
index 9f48761..0000000
+++ /dev/null
@@ -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
index 15de6f6745a767ef6f5b761bb436672fba6aac47..a09c513049137e641af16c8e8891cb65e21cb578 100644 (file)
@@ -35,7 +35,6 @@ 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_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')
 
 
@@ -173,36 +172,3 @@ class ConfigurationTest(testtools.TestCase):
                       plugin.supported_extension_aliases)
         self.assertIn('dhcp_agent_scheduler',
                       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)