development on df_check
This commit is contained in:
parent
e6a88649dc
commit
f4449481a7
14
df_check.py
14
df_check.py
|
@ -4,17 +4,19 @@ import os
|
||||||
|
|
||||||
|
|
||||||
file = open("/proc/partitions", "r")
|
file = open("/proc/partitions", "r")
|
||||||
file = file.read()
|
parts = file.read()
|
||||||
|
file.close()
|
||||||
|
|
||||||
# getting all local partitions (regardless if mounted or not)
|
# getting all local partitions (regardless if mounted or not)
|
||||||
partitions = []
|
partitions = []
|
||||||
for line in file.split("\n"):
|
blocks = []
|
||||||
#if "sd" in line or "hd" in line:
|
for line in parts.split("\n"):
|
||||||
#if line.split()[3] != None or line.split()[3] != "name":
|
|
||||||
if line and "name" not in line and "sr0" not in line:
|
if line and "name" not in line and "sr0" not in line:
|
||||||
partitions.append(line.split()[3])
|
if line.split()[2] != "1":
|
||||||
|
partitions.append(line.split()[3])
|
||||||
|
blocks.append(line.split()[2])
|
||||||
|
|
||||||
print "partitions on this system: %s" %(partitions)
|
print "partitions: %s \nblocks: %s" %(partitions, blocks)
|
||||||
|
|
||||||
|
|
||||||
exit()
|
exit()
|
||||||
|
|
Reference in New Issue