]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
enable F812 check for flake8
authorMark McClain <mmcclain@yahoo-inc.com>
Thu, 12 Jun 2014 01:23:53 +0000 (21:23 -0400)
committerMark McClain <mmcclain@yahoo-inc.com>
Fri, 14 Nov 2014 22:17:42 +0000 (17:17 -0500)
The change removes the shadowed variable in list comprehensions and
enables the F812 check

Change-Id: If7b4d6f198795565fe0d8e7524b73555e310cd14
Partial-Bug: 1329017

neutron/plugins/cisco/db/l3/device_handling_db.py
neutron/plugins/sriovnicagent/pci_lib.py
neutron/plugins/vmware/common/sync.py
neutron/services/vpn/device_drivers/ipsec.py
tox.ini

index 4e5deccd70919ec5883ed7ab993a436157c82e59..3e9469ba0dbfb521ef1d3c812a663db0a705fe80 100644 (file)
@@ -303,8 +303,8 @@ class DeviceHandlingMixin(object):
             agents = [hosting_device.cfg_agent for hosting_device in query
                       if hosting_device.cfg_agent is not None]
         if active is not None:
-            agents = [agent for agent in agents if not
-                      self.is_agent_down(agent['heartbeat_timestamp'])]
+            agents = [a for a in agents if not
+                      self.is_agent_down(a['heartbeat_timestamp'])]
         return agents
 
     def auto_schedule_hosting_devices(self, context, agent_host):
index 575d10c8d2a6327d496eb7acd62f416cdbd9d92c..065fd57aef2a314122fa0e9a7356fb292931a184 100644 (file)
@@ -63,8 +63,7 @@ class PciDeviceIPWrapper(ip_lib.IPWrapper):
                 vf_details = self._parse_vf_link_show(vf_line)
                 if vf_details:
                     vf_details_list.append(vf_details)
-        return [vf_details.get("MAC") for vf_details in
-                vf_details_list]
+        return [details.get("MAC") for details in vf_details_list]
 
     def get_vf_state(self, vf_index):
         """Get vf state {True/False}
index c7fa6aeec2b93df328a0053088ba3a851219dc84..fc52ac6555b431e6125beb2a022d431cb9ec9041 100644 (file)
@@ -329,7 +329,7 @@ class NsxSynchronizer():
 
         for network in networks:
             lswitches = neutron_nsx_mappings.get(network['id'], [])
-            lswitches = [lswitch.get('data') for lswitch in lswitches]
+            lswitches = [lsw.get('data') for lsw in lswitches]
             self.synchronize_network(ctx, network, lswitches)
 
     def synchronize_router(self, context, neutron_router_data,
index a3375fb0eaca2a9da29ca43b6868c494274a8da0..a7579e27deee8ed97c3496c79bdd39c89f70b9ee 100644 (file)
@@ -692,9 +692,7 @@ class IPsecDriver(device_drivers.DeviceDriver):
 
         # Delete any IPSec processes running
         # VPN that do not have an associated router.
-        process_ids = [process_id
-                       for process_id in self.processes
-                       if process_id not in router_ids]
+        process_ids = [pid for pid in self.processes if pid not in router_ids]
         for process_id in process_ids:
             self.destroy_router(process_id)
         self.report_status(context)
diff --git a/tox.ini b/tox.ini
index 6e57c14ab09334be1170a21d607409688739a761..442a6348b32275d83c829a83f49ee4c645b14f6e 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -65,7 +65,7 @@ commands = python setup.py build_sphinx
 # E128 continuation line under-indented for visual indent
 # E129 visually indented line with same indent as next logical line
 # E265 block comment should start with ‘# ‘
-# F812 list comprehension redefines name from line
+# H104 file contains nothing but comments
 # H237 module is removed in Python 3
 # H305 imports not grouped correctly
 # H307 like imports should be grouped together
@@ -74,7 +74,7 @@ commands = python setup.py build_sphinx
 # H405 multi line docstring summary not separated with an empty line
 # H904 Wrap long lines in parentheses instead of a backslash
 # TODO(marun) H404 multi line docstring should start with a summary
-ignore = E125,E126,E128,E129,E265,F812,H237,H305,H307,H401,H402,H404,H405,H904
+ignore = E125,E126,E128,E129,E265,H237,H305,H307,H401,H402,H404,H405,H904
 show-source = true
 builtins = _
 exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,tools,.ropeproject,rally-scenarios