]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
NSX: lift restriction on DVR update
authorSalvatore Orlando <salv.orlando@gmail.com>
Thu, 14 Aug 2014 19:46:09 +0000 (12:46 -0700)
committerSalvatore Orlando <salv.orlando@gmail.com>
Thu, 14 Aug 2014 20:56:14 +0000 (13:56 -0700)
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

neutron/plugins/vmware/common/exceptions.py
neutron/plugins/vmware/plugins/base.py
neutron/tests/unit/vmware/test_nsx_plugin.py

index 85032bfebdc07bd1db72f5a83e7ae366d1feb8b1..3f435bd531cd5c161aabd43aea894c813aefe665 100644 (file)
@@ -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")
index 12a1fb81bfb215e7fa7c45f0e2b3ef79e461a11d..9aa1b75e516375cf961f0ef67a6049d5555a94ae 100644 (file)
@@ -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
index ecb8ed8b4a656f1ee01aab50b76a2565449293bf..d3de5c221b0ad5e84723def80589d4bdd789ec98 100644 (file)
@@ -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)