Navigation Menu

Skip to content

Commit

Permalink
Fix AttributeError in RPC code for DVR
Browse files Browse the repository at this point in the history
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
  • Loading branch information
armando-migliaccio committed Nov 21, 2014
1 parent f63a8f0 commit eff0b35
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 25 deletions.
26 changes: 9 additions & 17 deletions neutron/api/rpc/handlers/dvr_rpc.py
Expand Up @@ -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):
Expand Down
Expand Up @@ -38,18 +38,15 @@ def __init__(self, topic, host):
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):
Expand Down

0 comments on commit eff0b35

Please sign in to comment.