Greg Swift
2011-03-20 18:21:41 UTC
func/minion/modules/disk.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
New commits:
commit 1a66cc90a60f9de9d3167cc70fecee0b87e50003
Author: Greg Swift <gregswift-***@public.gmane.org>
Date: Sun Mar 20 13:17:22 2011 -0500
Added file system time to the data gathered by disk modules' usage call
diff --git a/func/minion/modules/disk.py b/func/minion/modules/disk.py
index a2f0767..8cc9743 100644
--- a/func/minion/modules/disk.py
+++ b/func/minion/modules/disk.py
@@ -19,12 +19,12 @@ class DiskModule(func_module.FuncModule):
def usage(self, partition=None):
"""
- Returns the results of df -P
+ Returns the results of df -PT
"""
results = {}
# splitting the command variable out into a list does not seem to function
# in the tests I have run
- command = '/bin/df -P'
+ command = '/bin/df -PT'
if (partition):
command += ' %s' % (partition)
cmdref = sub_process.Popen(command, stdout=sub_process.PIPE,
@@ -34,11 +34,12 @@ class DiskModule(func_module.FuncModule):
for disk in stdout.split('\n'):
if (disk.startswith('Filesystem') or not disk):
continue
- (device, total, used, available, percentage, mount) = disk.split()
+ (device, fstype, total, used, available, percentage, mount) = disk.split()
results[mount] = {'device':device,
'total':str(total),
'used':str(used),
'available':str(available),
+ 'fstype':str(fstype),
'percentage':int(percentage[:-1])}
return results
1 file changed, 4 insertions(+), 3 deletions(-)
New commits:
commit 1a66cc90a60f9de9d3167cc70fecee0b87e50003
Author: Greg Swift <gregswift-***@public.gmane.org>
Date: Sun Mar 20 13:17:22 2011 -0500
Added file system time to the data gathered by disk modules' usage call
diff --git a/func/minion/modules/disk.py b/func/minion/modules/disk.py
index a2f0767..8cc9743 100644
--- a/func/minion/modules/disk.py
+++ b/func/minion/modules/disk.py
@@ -19,12 +19,12 @@ class DiskModule(func_module.FuncModule):
def usage(self, partition=None):
"""
- Returns the results of df -P
+ Returns the results of df -PT
"""
results = {}
# splitting the command variable out into a list does not seem to function
# in the tests I have run
- command = '/bin/df -P'
+ command = '/bin/df -PT'
if (partition):
command += ' %s' % (partition)
cmdref = sub_process.Popen(command, stdout=sub_process.PIPE,
@@ -34,11 +34,12 @@ class DiskModule(func_module.FuncModule):
for disk in stdout.split('\n'):
if (disk.startswith('Filesystem') or not disk):
continue
- (device, total, used, available, percentage, mount) = disk.split()
+ (device, fstype, total, used, available, percentage, mount) = disk.split()
results[mount] = {'device':device,
'total':str(total),
'used':str(used),
'available':str(available),
+ 'fstype':str(fstype),
'percentage':int(percentage[:-1])}
return results