~niedbalski/ubuntu/vivid/neutron/fixes-1447803

« back to all changes in this revision

Viewing changes to neutron/api/rpc/handlers/l3_rpc.py

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-10-03 18:45:23 UTC
  • mfrom: (1.1.15)
  • Revision ID: package-import@ubuntu.com-20141003184523-4mt6dy1q3j8n30c9
Tags: 1:2014.2~rc1-0ubuntu1
* New upstream release candidate:
  - d/p/*: Refreshed.
  - d/control: Add python-requests-mock to BD's.
  - d/control: Align versioned requirements with upstream.
* Transition linuxbridge and openvswitch plugin users to modular
  layer 2 plugin (LP: #1323729):
  - d/control: Mark removed plugin packages as transitional, depend
    on neutron-plugin-ml2, mark oldlibs/extra.
  - d/neutron-plugin-{linuxbridge,openvswitch}.install: Drop.
  - d/control: Depend on neutron-plugin-ml2 for linuxbridge
    agent package.
  - d/neutron-plugin-linuxbridge-agent.upstart: Use ml2 plugin
    configuration files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
    # 1.1  Support update_floatingip_statuses
39
39
    # 1.2 Added methods for DVR support
40
40
    # 1.3 Added a method that returns the list of activated services
41
 
    RPC_API_VERSION = '1.3'
 
41
    # 1.4 Added L3 HA update_router_state
 
42
    RPC_API_VERSION = '1.4'
42
43
 
43
44
    @property
44
45
    def plugin(self):
104
105
            for interface in router.get(constants.INTERFACE_KEY, []):
105
106
                self._ensure_host_set_on_port(context, host,
106
107
                                              interface, router['id'])
 
108
            interface = router.get(constants.HA_INTERFACE_KEY)
 
109
            if interface:
 
110
                self._ensure_host_set_on_port(context, host, interface,
 
111
                                              router['id'])
107
112
 
108
113
    def _ensure_host_set_on_port(self, context, host, port, router_id=None):
109
114
        if (port and
224
229
                  'and on host %(host)s', {'snat_port_list': snat_port_list,
225
230
                  'host': host})
226
231
        return snat_port_list
 
232
 
 
233
    def update_router_state(self, context, **kwargs):
 
234
        router_id = kwargs.get('router_id')
 
235
        state = kwargs.get('state')
 
236
        host = kwargs.get('host')
 
237
 
 
238
        return self.l3plugin.update_router_state(context, router_id, state,
 
239
                                                 host=host)