Merge "Remove unused parameter from _update_router_db method"
This commit is contained in:
commit
681e1ff1af
@ -188,7 +188,7 @@ class L3_NAT_dbonly_mixin(l3.RouterPluginBase):
|
||||
|
||||
return self._make_router_dict(router_db)
|
||||
|
||||
def _update_router_db(self, context, router_id, data, gw_info):
|
||||
def _update_router_db(self, context, router_id, data):
|
||||
"""Update the DB object."""
|
||||
with context.session.begin(subtransactions=True):
|
||||
router_db = self._get_router(context, router_id)
|
||||
@ -212,7 +212,7 @@ class L3_NAT_dbonly_mixin(l3.RouterPluginBase):
|
||||
self._update_router_gw_info(context, id, gw_info)
|
||||
else:
|
||||
candidates = None
|
||||
router_db = self._update_router_db(context, id, r, gw_info)
|
||||
router_db = self._update_router_db(context, id, r)
|
||||
if candidates:
|
||||
l3_plugin = manager.NeutronManager.get_service_plugins().get(
|
||||
constants.L3_ROUTER_NAT)
|
||||
|
@ -107,7 +107,7 @@ class L3_NAT_with_dvr_db_mixin(l3_db.L3_NAT_db_mixin,
|
||||
reason=e)
|
||||
|
||||
def _update_distributed_attr(
|
||||
self, context, router_id, router_db, data, gw_info):
|
||||
self, context, router_id, router_db, data):
|
||||
"""Update the model to support the dvr case of a router."""
|
||||
if data.get('distributed'):
|
||||
old_owner = l3_const.DEVICE_OWNER_ROUTER_INTF
|
||||
@ -116,18 +116,18 @@ class L3_NAT_with_dvr_db_mixin(l3_db.L3_NAT_db_mixin,
|
||||
rp.port_type = new_owner
|
||||
rp.port.device_owner = new_owner
|
||||
|
||||
def _update_router_db(self, context, router_id, data, gw_info):
|
||||
def _update_router_db(self, context, router_id, data):
|
||||
with context.session.begin(subtransactions=True):
|
||||
router_db = super(
|
||||
L3_NAT_with_dvr_db_mixin, self)._update_router_db(
|
||||
context, router_id, data, gw_info)
|
||||
context, router_id, data)
|
||||
migrating_to_distributed = (
|
||||
not router_db.extra_attributes.distributed and
|
||||
data.get('distributed') is True)
|
||||
self._validate_router_migration(context, router_db, data)
|
||||
router_db.extra_attributes.update(data)
|
||||
self._update_distributed_attr(
|
||||
context, router_id, router_db, data, gw_info)
|
||||
context, router_id, router_db, data)
|
||||
if migrating_to_distributed:
|
||||
if router_db['gw_port_id']:
|
||||
# If the Legacy router is getting migrated to a DVR
|
||||
|
@ -411,7 +411,7 @@ class L3_HA_NAT_db_mixin(l3_dvr_db.L3_NAT_with_dvr_db_mixin,
|
||||
router_dict['ha_vr_id'] = router_db.extra_attributes.ha_vr_id
|
||||
return router_dict
|
||||
|
||||
def _update_router_db(self, context, router_id, data, gw_info):
|
||||
def _update_router_db(self, context, router_id, data):
|
||||
router_db = self._get_router(context, router_id)
|
||||
|
||||
original_distributed_state = router_db.extra_attributes.distributed
|
||||
@ -427,7 +427,7 @@ class L3_HA_NAT_db_mixin(l3_dvr_db.L3_NAT_with_dvr_db_mixin,
|
||||
|
||||
with context.session.begin(subtransactions=True):
|
||||
router_db = super(L3_HA_NAT_db_mixin, self)._update_router_db(
|
||||
context, router_id, data, gw_info)
|
||||
context, router_id, data)
|
||||
|
||||
ha_not_changed = (requested_ha_state is None or
|
||||
requested_ha_state == original_ha_state)
|
||||
|
@ -122,7 +122,7 @@ class L3DvrTestCase(test_db_base_plugin_v2.NeutronDbPluginV2TestCase):
|
||||
return_value={'agents': [agent]})
|
||||
self.mixin._unbind_router = mock.Mock()
|
||||
router_db = self.mixin._update_router_db(
|
||||
self.ctx, router_id, distributed, mock.ANY)
|
||||
self.ctx, router_id, distributed)
|
||||
# Assert that the DB value has changed
|
||||
self.assertTrue(router_db.extra_attributes.distributed)
|
||||
self.assertEqual(1,
|
||||
|
@ -88,8 +88,7 @@ class L3HATestFramework(testlib_api.SqlTestCase):
|
||||
data['distributed'] = distributed
|
||||
if admin_state is not None:
|
||||
data['admin_state_up'] = admin_state
|
||||
return self.plugin._update_router_db(ctx, router_id,
|
||||
data, None)
|
||||
return self.plugin._update_router_db(ctx, router_id, data)
|
||||
|
||||
def _bind_router(self, router_id):
|
||||
with self.admin_ctx.session.begin(subtransactions=True):
|
||||
|
Loading…
Reference in New Issue
Block a user