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
This commit is contained in:
Salvatore Orlando
2014-08-14 12:46:09 -07:00
parent bdd4a7c018
commit 9fc8b6c4b4
3 changed files with 0 additions and 19 deletions

View 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")

View 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

View 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)