Remove unused L3 HA RPC method
The following patch will re-add it with its intended parameters and use it in the agent. Change-Id: Idffe963fffe5fdde6f474046a50208a2974edfa0 Partially-Implements: blueprint report-ha-router-master
This commit is contained in:
parent
9bae3b1832
commit
43bf99ee40
|
@ -39,7 +39,8 @@ class L3RpcCallback(object):
|
|||
# 1.1 Support update_floatingip_statuses
|
||||
# 1.2 Added methods for DVR support
|
||||
# 1.3 Added a method that returns the list of activated services
|
||||
# 1.4 Added L3 HA update_router_state
|
||||
# 1.4 Added L3 HA update_router_state. This method was later removed,
|
||||
# since it was unused. The RPC version was not changed.
|
||||
target = oslo_messaging.Target(version='1.4')
|
||||
|
||||
@property
|
||||
|
@ -208,11 +209,3 @@ class L3RpcCallback(object):
|
|||
'host %(host)s', {'agent_port': agent_port,
|
||||
'host': host})
|
||||
return agent_port
|
||||
|
||||
def update_router_state(self, context, **kwargs):
|
||||
router_id = kwargs.get('router_id')
|
||||
state = kwargs.get('state')
|
||||
host = kwargs.get('host')
|
||||
|
||||
return self.l3plugin.update_router_state(context, router_id, state,
|
||||
host=host)
|
||||
|
|
|
@ -28,7 +28,7 @@ from neutron.db import l3_dvr_db
|
|||
from neutron.db import model_base
|
||||
from neutron.db import models_v2
|
||||
from neutron.extensions import l3_ext_ha_mode as l3_ha
|
||||
from neutron.i18n import _LI, _LW
|
||||
from neutron.i18n import _LI
|
||||
|
||||
VR_ID_RANGE = set(range(1, 255))
|
||||
MAX_ALLOCATION_TRIES = 10
|
||||
|
@ -410,18 +410,6 @@ class L3_HA_NAT_db_mixin(l3_dvr_db.L3_NAT_with_dvr_db_mixin):
|
|||
|
||||
return router_db
|
||||
|
||||
def update_router_state(self, context, router_id, state, host):
|
||||
with context.session.begin(subtransactions=True):
|
||||
bindings = self.get_ha_router_port_bindings(context, [router_id],
|
||||
host)
|
||||
if bindings:
|
||||
if len(bindings) > 1:
|
||||
LOG.warn(_LW("The router %(router_id)s is bound multiple "
|
||||
"times on the agent %(host)s"),
|
||||
{'router_id': router_id, 'host': host})
|
||||
|
||||
bindings[0].update({'state': state})
|
||||
|
||||
def delete_router(self, context, id):
|
||||
router_db = self._get_router(context, id)
|
||||
super(L3_HA_NAT_db_mixin, self).delete_router(context, id)
|
||||
|
|
|
@ -197,23 +197,6 @@ class L3HATestCase(L3HATestFramework):
|
|||
interface['device_owner'])
|
||||
self.assertEqual(cfg.CONF.l3_ha_net_cidr, interface['subnet']['cidr'])
|
||||
|
||||
def test_update_state(self):
|
||||
router = self._create_router()
|
||||
self._bind_router(router['id'])
|
||||
routers = self.plugin.get_ha_sync_data_for_host(self.admin_ctx,
|
||||
self.agent1['host'])
|
||||
state = routers[0].get(constants.HA_ROUTER_STATE_KEY)
|
||||
self.assertEqual('standby', state)
|
||||
|
||||
self.plugin.update_router_state(self.admin_ctx, router['id'], 'active',
|
||||
self.agent1['host'])
|
||||
|
||||
routers = self.plugin.get_ha_sync_data_for_host(self.admin_ctx,
|
||||
self.agent1['host'])
|
||||
|
||||
state = routers[0].get(constants.HA_ROUTER_STATE_KEY)
|
||||
self.assertEqual('active', state)
|
||||
|
||||
def test_unique_ha_network_per_tenant(self):
|
||||
tenant1 = _uuid()
|
||||
tenant2 = _uuid()
|
||||
|
|
Loading…
Reference in New Issue