added mounted parts to the output in df_check
This commit is contained in:
parent
178b04fbf2
commit
7b79020887
|
@ -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)
|
||||
|
|
Reference in New Issue