check count of columns after split

If called on a device w/o extfs, a unhandled exception will be raise.
After add this check, is implies that attributes will be empty if the
device's filesystem is not extfs.
This commit is contained in:
Z. Liu 2016-11-21 14:45:24 +08:00
parent c62ff6b023
commit acf0f960ef

View file

@ -245,6 +245,8 @@ def dump(device, args=None):
elif line.startswith('Group') and not line.startswith('Group descriptor size'):
mode = 'blocks'
else:
if len(comps) < 2:
continue
ret['attributes'][comps[0]] = comps[1].strip()
if mode == 'blocks':