Merge pull request #1203 from kadel/develop

more generic way to do raid.list
This commit is contained in:
Thomas S Hatch 2012-05-04 12:32:12 -07:00
commit bfc4fe7ee3

View File

@ -30,15 +30,12 @@ def list():
if ' ' not in line:
continue
comps = line.split()
metadata = comps[2].split('=')
raidname = comps[3].split('=')
raiduuid = comps[4].split('=')
ret[comps[1]] = {
'device': comps[1],
'metadata': metadata[1],
'name': raidname[1],
'uuid': raiduuid[1],
}
device = comps[1]
ret[device] = {"device": device}
for comp in comps[2:]:
key = comp.split('=')[0].lower()
value = comp.split('=')[1]
ret[device][key] = value
return ret