From patchwork Tue Mar 3 19:15:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Mayhew X-Patchwork-Id: 5925671 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B1E4F9F373 for ; Tue, 3 Mar 2015 19:15:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 085722041B for ; Tue, 3 Mar 2015 19:15:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E6416202DD for ; Tue, 3 Mar 2015 19:15:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754631AbbCCTPV (ORCPT ); Tue, 3 Mar 2015 14:15:21 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56404 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752328AbbCCTPV (ORCPT ); Tue, 3 Mar 2015 14:15:21 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t23JFKQG012456 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Tue, 3 Mar 2015 14:15:20 -0500 Received: from tonberry.usersys.redhat.com (dhcp145-188.rdu.redhat.com [10.13.145.188]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t23JFKMk032675 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 3 Mar 2015 14:15:20 -0500 Received: from tonberry.usersys.redhat.com (localhost [127.0.0.1]) by tonberry.usersys.redhat.com (8.14.8/8.14.5) with ESMTP id t23JFJfl030761; Tue, 3 Mar 2015 14:15:19 -0500 Received: (from smayhew@localhost) by tonberry.usersys.redhat.com (8.14.8/8.14.8/Submit) id t23JFJD0030760; Tue, 3 Mar 2015 14:15:19 -0500 From: Scott Mayhew 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 Message-Id: <1425410119-30725-1-git-send-email-smayhew@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Normalize the mountpoints passed on the command line so that commands like 'mountstats /mnt/' succeed rather than fail. Signed-off-by: Scott Mayhew --- 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)