]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Remove unused variables from get_devices_details_list
authorElena Ezhova <eezhova@mirantis.com>
Thu, 27 Nov 2014 07:33:04 +0000 (10:33 +0300)
committerElena Ezhova <eezhova@mirantis.com>
Thu, 27 Nov 2014 07:33:04 +0000 (10:33 +0300)
Initialization of res with empty list is not needed because
res is always assigned with a new value in try/except block.

A method invocation context is created in get_device_details
and need not be initialized in get_devices_details_list because
it is never used there.

Change-Id: I2ff73390ca173cee6d73aaafdcc0c525670e358b

neutron/agent/rpc.py

index 3f8d5e291e14674e5b424f12e20198e7f065907d..fb9c54987f88e7f54e1c689ac4cff2462f13b37b 100644 (file)
@@ -89,7 +89,6 @@ class PluginApi(object):
                           agent_id=agent_id, host=host)
 
     def get_devices_details_list(self, context, devices, agent_id, host=None):
-        res = []
         try:
             cctxt = self.client.prepare(version='1.3')
             res = cctxt.call(context, 'get_devices_details_list',
@@ -100,7 +99,6 @@ class PluginApi(object):
             # mode, in that DVR routers may not be in the system yet, and
             # it might be not necessary to retrieve info about the host.
             LOG.warn(_LW('DVR functionality requires a server upgrade.'))
-            cctxt = self.client.prepare()
             res = [
                 self.get_device_details(context, device, agent_id, host)
                 for device in devices