socialnerds/hive
socialnerds
/
hive
Archived
1
0
Fork 0

development on df_check

This commit is contained in:
David 2012-05-15 17:22:05 +02:00
parent e6a88649dc
commit f4449481a7
1 changed files with 8 additions and 6 deletions

View File

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