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()
|
mounts = file.read()
|
||||||
file.close()
|
file.close()
|
||||||
|
|
||||||
|
|
||||||
partitions = []
|
partitions = []
|
||||||
blocks = []
|
blocks = []
|
||||||
# getting all local partitions (regardless if mounted or not)
|
# getting all local partitions (regardless if mounted or not)
|
||||||
|
@ -48,17 +49,20 @@ for part in partitions:
|
||||||
partitions = partsnew
|
partitions = partsnew
|
||||||
blocks = blocksnew
|
blocks = blocksnew
|
||||||
|
|
||||||
|
|
||||||
# getting mounted partitions and their mountpoints
|
# getting mounted partitions and their mountpoints
|
||||||
mountpoints = []
|
mountpoints = []
|
||||||
|
mountparts = []
|
||||||
for item in partitions:
|
for item in partitions:
|
||||||
for line in mounts.split("\n"):
|
for line in mounts.split("\n"):
|
||||||
if line and item in line:
|
if line and item in line:
|
||||||
mountpoints.append(line.split()[1])
|
mountpoints.append(line.split()[1])
|
||||||
|
mountparts.append(item)
|
||||||
break
|
break
|
||||||
|
|
||||||
# output for debugging
|
# 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)
|
# given paths(mountpoints)
|
||||||
|
|
Reference in New Issue