Skip to contentSkip to conversation

nfsiostat: normalize the mountpoints passed in from the command line

PATCH In review Scott Mayhew 2 participants 2 messages Jan 22 – Jan 26

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

PATCH 1/1 nfsiostat: normalize the mountpoints passed in from the command line

If the mountpoint passed in from the command line contains a trailing '/' character, then nfsiostat winds up printing statistics for all mounts instead of printing statistics for the specific mount that was requested.

---
 tools/nfs-iostat/nfs-iostat.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/nfs-iostat/nfs-iostat.py +2 -2
index e46b1a83..69d24a11 100755
@@ -589,8 +589,8 @@ client are listed.
 
     (options, args) = parser.parse_args(sys.argv)
     for arg in args[1:]:
-        if arg in mountstats:
-            origdevices += [arg]
+        if os.path.normpath(arg) in mountstats:
+            origdevices += [os.path.normpath(arg)]
         elif not interval_seen:
             try:
                 interval = int(arg)
Signature · 1 line
2.52.0
#1 lore raw
Quoted 6 lines · Scott Mayhew

If the mountpoint passed in from the command line contains a trailing '/' character, then nfsiostat winds up printing statistics for all mounts instead of printing statistics for the specific mount that was requested.

Committed... (tag: nfs-utils-2-8-5-rc2)

steved.

Quoted 19 lines
---
  tools/nfs-iostat/nfs-iostat.py | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
tools/nfs-iostat/nfs-iostat.py +2 -2
index e46b1a83..69d24a11 100755
@@ -589,8 +589,8 @@ client are listed.
 
      (options, args) = parser.parse_args(sys.argv)
      for arg in args[1:]:
-        if arg in mountstats:
-            origdevices += [arg]
+        if os.path.normpath(arg) in mountstats:
+            origdevices += [os.path.normpath(arg)]
          elif not interval_seen:
              try:
                  interval = int(arg)