Renamed gather() to update() in disk_mon.py
This commit is contained in:
parent
f084e1303e
commit
326b4d70d5
22
disk_mon.py
22
disk_mon.py
|
@ -1,25 +1,21 @@
|
|||
#!/usr/bin/python2
|
||||
|
||||
#
|
||||
# disk monitor
|
||||
#
|
||||
|
||||
#imports
|
||||
import os
|
||||
|
||||
""" disk monitor """
|
||||
|
||||
class diskmon(object):
|
||||
"""collect information about local partitions"""
|
||||
|
||||
def __init__(self):
|
||||
self.gather()
|
||||
self.update()
|
||||
|
||||
def gather(self):
|
||||
"""gather the actual information"""
|
||||
def update(self):
|
||||
"""run collection of data"""
|
||||
|
||||
self.partitions = [] #information about all partitions (list of lists)
|
||||
uuids = os.listdir("/dev/disk/by-uuid") #folder contains symlinks to the actual disk devices
|
||||
for uuid in uuids: #write /dev/names as keys and uuids as values in the dictionary
|
||||
import os
|
||||
|
||||
self.partitions = []
|
||||
uuids = os.listdir("/dev/disk/by-uuid")
|
||||
for uuid in uuids:
|
||||
part = {}
|
||||
part["device"] = str("/dev/" + os.readlink("/dev/disk/by-uuid/" + uuid)[6:])
|
||||
part["uuid"] = uuid
|
||||
|
|
Reference in New Issue