diff options
author | Steve Dickson <steved@redhat.com> | 2011-09-21 14:05:07 -0400 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2011-09-21 15:41:59 -0400 |
commit | 4ee1190080fbb8cdd5ed2bef7c00a04799650b1b (patch) | |
tree | 2832c886f5818b4894fd5c2ccffc6332a2dbb4d7 /tools/mountstats | |
parent | c9823f479f2d0d379d85a37ad2af41faca6cc911 (diff) | |
download | nfs-utils-4ee1190080fbb8cdd5ed2bef7c00a04799650b1b.tar.gz |
mountstats: Breaks on 3.1 kernelsnfs-utils-1-2-5-rc3
mountstats depend on all devices entries in /proc/self/mountstats
to start with the word 'device'. With 3.1 kernels, NFS entries
start with the actual device (i.e. server:/export) not
the word 'device'. This change confused mountstats parsing.
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'tools/mountstats')
-rw-r--r-- | tools/mountstats/mountstats.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/mountstats/mountstats.py b/tools/mountstats/mountstats.py index 280e15c..b95b71d 100644 --- a/tools/mountstats/mountstats.py +++ b/tools/mountstats/mountstats.py @@ -46,6 +46,12 @@ class DeviceData: self.__nfs_data['fstype'] = words[7] if words[7].find('nfs') != -1: 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: + self.__nfs_data['statvers'] = words[7] elif words[0] == 'age:': self.__nfs_data['age'] = long(words[1]) elif words[0] == 'opts:': @@ -371,6 +377,9 @@ def parse_stats_file(filename): if words[0] == 'device': key = words[4] new = [ line.strip() ] + elif 'nfs' in words or 'nfs4' in words: + key = words[3] + new = [ line.strip() ] else: new += [ line.strip() ] ms_dict[key] = new |