Skip to contentSkip to conversation

nfsiostat: replace 'list' reserved word

PATCH In review Matthew Ruffell 3 participants 3 messages Mar 24, 2019 – Mar 28, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfsiostat: replace 'list' reserved word

list is a reserved word in python and should not be used as a variable name. Changing list to devicelist for list_nfs_mounts()

---
 tools/nfs-iostat/nfs-iostat.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
tools/nfs-iostat/nfs-iostat.py +4 -4
index 7cbe543..dec0e86 100644
@@ -493,20 +493,20 @@ def list_nfs_mounts(givenlist, mountstats):
        return a full list if the given list is empty -
        may return an empty list if none found
     """
-    list = []
+    devicelist = []
     if len(givenlist) > 0:
         for device in givenlist:
             stats = DeviceData()
             stats.parse_stats(mountstats[device])
             if stats.is_nfs_mountpoint():
-                list += [device]
+                devicelist += [device]
     else:
         for device, descr in mountstats.items():
             stats = DeviceData()
             stats.parse_stats(descr)
             if stats.is_nfs_mountpoint():
-                list += [device]
-    return list
+                devicelist += [device]
+    return devicelist
 
 def iostat_command(name):
     """iostat-like command for NFS mount points
Signature · 1 line
2.19.1
#1 lore raw

Adding steved to cc.--b.

Quoted 41 lines · Matthew Ruffell

list is a reserved word in python and should not be used as a variable name. Changing list to devicelist for list_nfs_mounts()

---
 tools/nfs-iostat/nfs-iostat.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
tools/nfs-iostat/nfs-iostat.py +4 -4
index 7cbe543..dec0e86 100644
@@ -493,20 +493,20 @@ def list_nfs_mounts(givenlist, mountstats):
        return a full list if the given list is empty -
        may return an empty list if none found
     """
-    list = []
+    devicelist = []
     if len(givenlist) > 0:
         for device in givenlist:
             stats = DeviceData()
             stats.parse_stats(mountstats[device])
             if stats.is_nfs_mountpoint():
-                list += [device]
+                devicelist += [device]
     else:
         for device, descr in mountstats.items():
             stats = DeviceData()
             stats.parse_stats(descr)
             if stats.is_nfs_mountpoint():
-                list += [device]
-    return list
+                devicelist += [device]
+    return devicelist
 
 def iostat_command(name):
     """iostat-like command for NFS mount points
Signature · 1 line
2.19.1
#2 lore raw
In reply to Matthew Ruffell
Quoted 6 lines · Matthew Ruffell

list is a reserved word in python and should not be used as a variable name. Changing list to devicelist for list_nfs_mounts()

Committed...

steved.

Quoted 34 lines
---
 tools/nfs-iostat/nfs-iostat.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
tools/nfs-iostat/nfs-iostat.py +4 -4
index 7cbe543..dec0e86 100644
@@ -493,20 +493,20 @@ def list_nfs_mounts(givenlist, mountstats):
        return a full list if the given list is empty -
        may return an empty list if none found
     """
-    list = []
+    devicelist = []
     if len(givenlist) > 0:
         for device in givenlist:
             stats = DeviceData()
             stats.parse_stats(mountstats[device])
             if stats.is_nfs_mountpoint():
-                list += [device]
+                devicelist += [device]
     else:
         for device, descr in mountstats.items():
             stats = DeviceData()
             stats.parse_stats(descr)
             if stats.is_nfs_mountpoint():
-                list += [device]
-    return list
+                devicelist += [device]
+    return devicelist
 
 def iostat_command(name):
     """iostat-like command for NFS mount points