From 7b79020887a7c74af373b0dd6670f9d3a7a26166 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 15 May 2012 23:09:46 +0200 Subject: [PATCH] added mounted parts to the output in df_check --- df_check.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/df_check.py b/df_check.py index 0001b09..85667fb 100755 --- a/df_check.py +++ b/df_check.py @@ -12,6 +12,7 @@ file = open("/proc/mounts", "r") mounts = file.read() file.close() + partitions = [] blocks = [] # getting all local partitions (regardless if mounted or not) @@ -48,17 +49,20 @@ for part in partitions: partitions = partsnew blocks = blocksnew - # getting mounted partitions and their mountpoints mountpoints = [] +mountparts = [] for item in partitions: for line in mounts.split("\n"): if line and item in line: mountpoints.append(line.split()[1]) + mountparts.append(item) break # output for debugging -print "partitions: %s\nblocks: %s\nmountpoints: %s" %(partitions, blocks, mountpoints) +print "debug output:" +print "availible partitions: %s\nblocks: %s\nmounted partitions: %s\nmountpoints: %s" %(partitions, blocks, mountparts, mountpoints) +print "" #linebreak # given paths(mountpoints)