diff mbox series

[ovs-dev] ovs-bugtool: Fix ambiguous variable flake8 warnings

Message ID 20180308011846.18284-1-aserdean@ovn.org
State Accepted
Headers show
Series [ovs-dev] ovs-bugtool: Fix ambiguous variable flake8 warnings | expand

Commit Message

Alin-Gabriel Serdean March 8, 2018, 1:18 a.m. UTC
Flake8 complains:
utilities/bugtool/ovs-bugtool.in:761:5: E741 ambiguous variable name 'l'
utilities/bugtool/ovs-bugtool.in:1162:5: E741 ambiguous variable name 'l'
Makefile:6193: recipe for target 'flake8-check' failed

Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
---
 utilities/bugtool/ovs-bugtool.in | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Ben Pfaff March 8, 2018, 1:25 a.m. UTC | #1
On Thu, Mar 08, 2018 at 03:18:46AM +0200, Alin Gabriel Serdean wrote:
> Flake8 complains:
> utilities/bugtool/ovs-bugtool.in:761:5: E741 ambiguous variable name 'l'
> utilities/bugtool/ovs-bugtool.in:1162:5: E741 ambiguous variable name 'l'
> Makefile:6193: recipe for target 'flake8-check' failed
> 
> Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>

I applied this to master.

(Afterward I realized that I should have let you do that.  Sorry!)
Alin-Gabriel Serdean March 8, 2018, 1:51 a.m. UTC | #2
No worries!

> -----Mesaj original-----
> De la: ovs-dev-bounces@openvswitch.org <ovs-dev-
> bounces@openvswitch.org> În numele Ben Pfaff
> Trimis: Thursday, March 8, 2018 3:25 AM
> Către: Alin Gabriel Serdean <aserdean@ovn.org>
> Cc: dev@openvswitch.org
> Subiect: Re: [ovs-dev] [PATCH] ovs-bugtool: Fix ambiguous variable flake8
> warnings
> 
> On Thu, Mar 08, 2018 at 03:18:46AM +0200, Alin Gabriel Serdean wrote:
> > Flake8 complains:
> > utilities/bugtool/ovs-bugtool.in:761:5: E741 ambiguous variable name 'l'
> > utilities/bugtool/ovs-bugtool.in:1162:5: E741 ambiguous variable name
'l'
> > Makefile:6193: recipe for target 'flake8-check' failed
> >
> > Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
> 
> I applied this to master.
> 
> (Afterward I realized that I should have let you do that.  Sorry!)
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
diff mbox series

Patch

diff --git a/utilities/bugtool/ovs-bugtool.in b/utilities/bugtool/ovs-bugtool.in
index 8d220fd74..288c34f98 100755
--- a/utilities/bugtool/ovs-bugtool.in
+++ b/utilities/bugtool/ovs-bugtool.in
@@ -758,10 +758,10 @@  exclude those logs from the archive.
 
 def dump_scsi_hosts(cap):
     output = ''
-    l = os.listdir('/sys/class/scsi_host')
-    l.sort()
+    scsi_list = os.listdir('/sys/class/scsi_host')
+    scsi_list.sort()
 
-    for h in l:
+    for h in scsi_list:
         procname = ''
         try:
                 f = open('/sys/class/scsi_host/%s/proc_name' % h)
@@ -1159,9 +1159,9 @@  def update_cap_size(cap, size):
 
 def update_cap(cap, k, v):
     global caps
-    l = list(caps[cap])
-    l[k] = v
-    caps[cap] = tuple(l)
+    temp = list(caps[cap])
+    temp[k] = v
+    caps[cap] = tuple(temp)
 
 
 def size_of_dir(d, pattern=None, negate=False):