socialnerds/hive
socialnerds
/
hive
Archived
1
0
Fork 0

added mounted parts to the output in df_check

This commit is contained in:
David 2012-05-15 23:09:46 +02:00
parent 178b04fbf2
commit 7b79020887
1 changed files with 6 additions and 2 deletions

View File

@ -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)