]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Fix AttributeError in RPC code for DVR
authorarmando-migliaccio <armamig@gmail.com>
Fri, 21 Nov 2014 06:15:34 +0000 (22:15 -0800)
committerarmando-migliaccio <armamig@gmail.com>
Fri, 21 Nov 2014 16:01:52 +0000 (08:01 -0800)
Fix the usage of call methods as per recent changes according to
drop-rpc-compat. These changes went overlooked and it broke DVR.

Tests will be done as follow-up.

Partial-bug: #1394848

Change-Id: I6e0584f8e54e606a76b87853b2371cc8e24eba69

neutron/api/rpc/handlers/dvr_rpc.py
neutron/services/firewall/agents/l3reference/firewall_l3_agent.py

index 7e26cdc5c746af57342852dd33931126d7d214cc..ba648bb0ae1dbb26b38bea3961322265c5b07611 100644 (file)
@@ -30,32 +30,24 @@ class DVRServerRpcApiMixin(object):
 
     @log.log
     def get_dvr_mac_address_by_host(self, context, host):
-        return self.call(context,
-                         self.make_msg('get_dvr_mac_address_by_host',
-                                       host=host),
-                         version=self.DVR_RPC_VERSION)
+        cctxt = self.client.prepare(version=self.DVR_RPC_VERSION)
+        return cctxt.call(context, 'get_dvr_mac_address_by_host', host=host)
 
     @log.log
     def get_dvr_mac_address_list(self, context):
-        return self.call(context,
-                         self.make_msg('get_dvr_mac_address_list'),
-                         version=self.DVR_RPC_VERSION)
+        cctxt = self.client.prepare(version=self.DVR_RPC_VERSION)
+        return cctxt.call(context, 'get_dvr_mac_address_list')
 
     @log.log
     def get_ports_on_host_by_subnet(self, context, host, subnet):
-        return self.call(context,
-                         self.make_msg(
-                             'get_ports_on_host_by_subnet',
-                             host=host,
-                             subnet=subnet),
-                         version=self.DVR_RPC_VERSION)
+        cctxt = self.client.prepare(version=self.DVR_RPC_VERSION)
+        return cctxt.call(context, 'get_ports_on_host_by_subnet',
+                          host=host, subnet=subnet)
 
     @log.log
     def get_subnet_for_dvr(self, context, subnet):
-        return self.call(context,
-                         self.make_msg('get_subnet_for_dvr',
-                                       subnet=subnet),
-                         version=self.DVR_RPC_VERSION)
+        cctxt = self.client.prepare(version=self.DVR_RPC_VERSION)
+        return cctxt.call(context, 'get_subnet_for_dvr', subnet=subnet)
 
 
 class DVRServerRpcCallback(object):
index 8dc38f6555d44ae456ccb4eb58c61928bbf56c30..67b9324ad5ab9158757793a3ce6b7e8720a11eea 100644 (file)
@@ -38,18 +38,15 @@ class FWaaSL3PluginApi(api.FWaaSPluginApiMixin):
     def get_firewalls_for_tenant(self, context, **kwargs):
         """Get the Firewalls with rules from the Plugin to send to driver."""
         LOG.debug("Retrieve Firewall with rules from Plugin")
-
-        return self.call(context,
-                         self.make_msg('get_firewalls_for_tenant',
-                                       host=self.host))
+        cctxt = self.client.prepare()
+        return cctxt.call(context, 'get_firewalls_for_tenant', host=self.host)
 
     def get_tenants_with_firewalls(self, context, **kwargs):
         """Get all Tenants that have Firewalls configured from plugin."""
         LOG.debug("Retrieve Tenants with Firewalls configured from Plugin")
-
-        return self.call(context,
-                         self.make_msg('get_tenants_with_firewalls',
-                                       host=self.host))
+        cctxt = self.client.prepare()
+        return cctxt.call(context,
+                          'get_tenants_with_firewalls', host=self.host)
 
 
 class FWaaSL3AgentRpcCallback(api.FWaaSAgentRpcCallbackMixin):