From: Salvatore Orlando Date: Thu, 14 Aug 2014 19:46:09 +0000 (-0700) Subject: NSX: lift restriction on DVR update X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=9fc8b6c4b4d43df50b9bc15f4fdf274ad6dd711c;p=openstack-build%2Fneutron-build.git NSX: lift restriction on DVR update The restriction in place in the code is not justified considered the capabilities of the DVR extension and the NSX backend. Transformations of centralized routers into distributed should be allowed. Change-Id: I099b90d39247bc9a7adfb87344d77ccd8acfad9e Closes-Bug: #1357048 --- diff --git a/neutron/plugins/vmware/common/exceptions.py b/neutron/plugins/vmware/common/exceptions.py index 85032bfeb..3f435bd53 100644 --- a/neutron/plugins/vmware/common/exceptions.py +++ b/neutron/plugins/vmware/common/exceptions.py @@ -119,7 +119,3 @@ class LsnMigrationConflict(n_exc.Conflict): class LsnConfigurationConflict(NsxPluginException): message = _("Configuration conflict on Logical Service Node %(lsn_id)s") - - -class ReadOnlyAttribute(NsxPluginException): - message = _("Cannot update read-only attribute %(attribute)s") diff --git a/neutron/plugins/vmware/plugins/base.py b/neutron/plugins/vmware/plugins/base.py index 12a1fb81b..9aa1b75e5 100644 --- a/neutron/plugins/vmware/plugins/base.py +++ b/neutron/plugins/vmware/plugins/base.py @@ -742,8 +742,6 @@ class NsxPluginV2(addr_pair_db.AllowedAddressPairsMixin, webob.exc.HTTPBadRequest, nsx_exc.NoMorePortsException: webob.exc.HTTPBadRequest, - nsx_exc.ReadOnlyAttribute: - webob.exc.HTTPBadRequest, nsx_exc.MaintenanceInProgress: webob.exc.HTTPServiceUnavailable, nsx_exc.InvalidSecurityCertificate: @@ -1485,9 +1483,6 @@ class NsxPluginV2(addr_pair_db.AllowedAddressPairsMixin, self.cluster, nsx_router_id, routes) def update_router(self, context, router_id, router): - if isinstance(router['router'].get('distributed'), bool): - # Router conversion is not supported - raise nsx_exc.ReadOnlyAttribute(attribute='distributed') # Either nexthop is updated or should be kept as it was before r = router['router'] nexthop = None diff --git a/neutron/tests/unit/vmware/test_nsx_plugin.py b/neutron/tests/unit/vmware/test_nsx_plugin.py index ecb8ed8b4..d3de5c221 100644 --- a/neutron/tests/unit/vmware/test_nsx_plugin.py +++ b/neutron/tests/unit/vmware/test_nsx_plugin.py @@ -1225,16 +1225,6 @@ class NeutronNsxOutOfSync(NsxPluginV2TestCase, self._test_remove_router_interface_nsx_out_of_sync(unsync_action) - def test_update_router_distributed_bad_request(self): - res = self._create_router('json', 'tenant') - router = self.deserialize('json', res) - req = self.new_update_request( - 'routers', - {'router': {'distributed': True}}, - router['router']['id']) - res = req.get_response(self.ext_api) - self.assertEqual(res.status_int, 400) - def test_update_router_not_in_nsx(self): res = self._create_router('json', 'tenant') router = self.deserialize('json', res)