All of lore.kernel.org
 help / color / mirror / Atom feed
From: Scott Mayhew <smayhew@redhat.com>
To: steved@redhat.com
Cc: linux-nfs@vger.kernel.org
Subject: [nfs-utils PATCH] mountstats: Normalize the mountpoints passed on the command line.
Date: Tue,  3 Mar 2015 14:15:19 -0500	[thread overview]
Message-ID: <1425410119-30725-1-git-send-email-smayhew@redhat.com> (raw)

Normalize the mountpoints passed on the command line so that commands
like 'mountstats /mnt/' succeed rather than fail.

Signed-off-by: Scott Mayhew <smayhew@redhat.com>
---
 tools/mountstats/mountstats.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/mountstats/mountstats.py b/tools/mountstats/mountstats.py
index 7f5dee1..38943eb 100644
--- a/tools/mountstats/mountstats.py
+++ b/tools/mountstats/mountstats.py
@@ -686,7 +686,7 @@ def mountstats_command(args):
     """Mountstats command
     """
     mountstats = parse_stats_file(args.infile)
-    mountpoints = args.mountpoints
+    mountpoints = [os.path.normpath(mp) for mp in args.mountpoints]
 
     # make certain devices contains only NFS mount points
     if len(mountpoints) > 0:
@@ -735,7 +735,7 @@ def nfsstat_command(args):
     """nfsstat-like command for NFS mount points
     """
     mountstats = parse_stats_file(args.infile)
-    mountpoints = args.mountpoints
+    mountpoints = [os.path.normpath(mp) for mp in args.mountpoints]
     v3stats = DeviceData()
     v3stats.setup_accumulator(Nfsv3ops)
     v4stats = DeviceData()
@@ -822,7 +822,7 @@ def iostat_command(args):
     """iostat-like command for NFS mount points
     """
     mountstats = parse_stats_file(args.infile)
-    devices = args.mountpoints
+    devices = [os.path.normpath(mp) for mp in args.mountpoints]
 
     if args.since:
         old_mountstats = parse_stats_file(args.since)
-- 
1.9.3


             reply	other threads:[~2015-03-03 19:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-03 19:15 Scott Mayhew [this message]
2015-03-04 13:12 ` [nfs-utils PATCH] mountstats: Normalize the mountpoints passed on the command line Steve Dickson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1425410119-30725-1-git-send-email-smayhew@redhat.com \
    --to=smayhew@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=steved@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.