Skip to content

Commit

Permalink
Allow for empty <STORAGE> sections in get_embedded_health output
Browse files Browse the repository at this point in the history
  • Loading branch information
seveas committed Jul 23, 2014
1 parent 47344e9 commit 0fa74cb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hpilo.py
Original file line number Diff line number Diff line change
Expand Up @@ -849,12 +849,12 @@ def process(data):
health[key].update(val)
data[category] = health
continue
elif isinstance(data[category], list):
elif isinstance(data[category], list) and data[category]:
for tag in ('label', 'location'):
if tag in data[category][0]:
data[category] = dict([(x[tag], x) for x in data[category]])
break
elif data[category] == '':
elif data[category] in ['', []]:
data[category] = None
return data
return self._info_tag('SERVER_INFO', 'GET_EMBEDDED_HEALTH', 'GET_EMBEDDED_HEALTH_DATA',
Expand Down

0 comments on commit 0fa74cb

Please sign in to comment.