# 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
'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)
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
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)
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()