development on df_check
This commit is contained in:
parent
e6a88649dc
commit
f4449481a7
12
df_check.py
12
df_check.py
|
@ -4,17 +4,19 @@ import os
|
|||
|
||||
|
||||
file = open("/proc/partitions", "r")
|
||||
file = file.read()
|
||||
parts = file.read()
|
||||
file.close()
|
||||
|
||||
# getting all local partitions (regardless if mounted or not)
|
||||
partitions = []
|
||||
for line in file.split("\n"):
|
||||
#if "sd" in line or "hd" in line:
|
||||
#if line.split()[3] != None or line.split()[3] != "name":
|
||||
blocks = []
|
||||
for line in parts.split("\n"):
|
||||
if line and "name" not in line and "sr0" not in line:
|
||||
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()
|
||||
|
|
Reference in New Issue