|
|
|
@ -90,9 +90,12 @@ class fillVars(object, glob_attr):
|
|
|
|
|
|
|
|
|
|
def get_os_device_hash(self):
|
|
|
|
|
diskIdPath = '/dev/disk/by-id'
|
|
|
|
|
usbdevices = \
|
|
|
|
|
map(lambda x: readlink(pathjoin(diskIdPath,x)).rpartition('/')[2],
|
|
|
|
|
filter(lambda x: x.startswith('usb-'),listdir(diskIdPath)))
|
|
|
|
|
if pathexists(diskIdPath):
|
|
|
|
|
usbdevices = \
|
|
|
|
|
map(lambda x: readlink(pathjoin(diskIdPath,x)).rpartition('/')[2],
|
|
|
|
|
filter(lambda x: x.startswith('usb-'),listdir(diskIdPath)))
|
|
|
|
|
else:
|
|
|
|
|
usbdevices = []
|
|
|
|
|
reWrongDevice = re.compile("|".join(['sr','fd','ram','loop']))
|
|
|
|
|
devices = filter( lambda x: not reWrongDevice.search(x),
|
|
|
|
|
listdir('/sys/block'))
|
|
|
|
|