Fix parsing disk usage for line with no number and AIX values in Kilos

This commit is contained in:
David Murphy 2016-01-05 15:05:59 -07:00
parent bed38d1a65
commit 8450df0483

View file

@ -68,6 +68,8 @@ def usage(args=None):
cmd = 'df -P'
elif __grains__['kernel'] == 'OpenBSD':
cmd = 'df -kP'
elif __grains__['kernel'] == 'AIX':
cmd = 'df -kP'
else:
cmd = 'df'
if flags:
@ -88,9 +90,11 @@ def usage(args=None):
continue
else:
oldline = None
while not comps[1].isdigit():
while len(comps) >= 2 and not comps[1].isdigit():
comps[0] = '{0} {1}'.format(comps[0], comps[1])
comps.pop(1)
if len(comps) < 2:
continue
try:
if __grains__['kernel'] == 'Darwin':
ret[comps[8]] = {