diff options
author | Scott Mayhew <smayhew@redhat.com> | 2014-10-21 13:23:03 -0400 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2014-12-13 10:40:28 -0500 |
commit | cb4b4bc950511f87c07bf34f519db8237d494838 (patch) | |
tree | 0503ccb0e73d95d8dbb8058fc03ed55fd748c807 | |
parent | 072a2556ebbac6f59d5c7624a829d0d93f9c38ba (diff) | |
download | nfs-utils-cb4b4bc950511f87c07bf34f519db8237d494838.tar.gz nfs-utils-cb4b4bc950511f87c07bf34f519db8237d494838.tar.xz nfs-utils-cb4b4bc950511f87c07bf34f519db8237d494838.zip |
mountstats: Fix IndexError in __parse_nfs_line
If __parse_nfs_line is is called on a line that has 'fstype nfsd', it'll
raise an IndexError trying to parse a nonexistent statvers entry.
Signed-off-by: Scott Mayhew <smayhew@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r-- | tools/mountstats/mountstats.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/mountstats/mountstats.py b/tools/mountstats/mountstats.py index 18d9514..769c458 100644 --- a/tools/mountstats/mountstats.py +++ b/tools/mountstats/mountstats.py @@ -221,13 +221,13 @@ class DeviceData: self.__nfs_data['export'] = words[1] self.__nfs_data['mountpoint'] = words[4] self.__nfs_data['fstype'] = words[7] - if words[7].find('nfs') != -1: + if words[7].find('nfs') != -1 and words[7] != 'nfsd': self.__nfs_data['statvers'] = words[8] elif 'nfs' in words or 'nfs4' in words: self.__nfs_data['export'] = words[0] self.__nfs_data['mountpoint'] = words[3] self.__nfs_data['fstype'] = words[6] - if words[6].find('nfs') != -1: + if words[6].find('nfs') != -1 and words[6] != 'nfsd': self.__nfs_data['statvers'] = words[7] elif words[0] == 'age:': self.__nfs_data['age'] = int(words[1]) |