mirror of
https://github.com/xcat2/confluent.git
synced 2024-12-23 19:52:10 +00:00
Fix nodeeventlog with 'None' entries
Some entries have 'None' fields. Gracefully tolerate this scenario.
This commit is contained in:
parent
9e4ee7bb31
commit
b503d9ca11
@ -49,11 +49,11 @@ def format_event(evt):
|
||||
display = dt.strptime(evt['timestamp'], '%Y-%m-%dT%H:%M:%S')
|
||||
retparts.append(display.strftime('%m/%d/%Y %H:%M:%S'))
|
||||
dscparts = []
|
||||
if 'component_type' in evt:
|
||||
if 'component_type' in evt and evt['component_type'] is not None:
|
||||
dscparts.append(evt['component_type'])
|
||||
if 'component' in evt and evt['component'] is not None:
|
||||
dscparts.append(evt['component'])
|
||||
if 'event' in evt and evt['event']:
|
||||
if 'event' in evt and evt['event'] and evt['event'] is not None:
|
||||
evttext = evt['event']
|
||||
try:
|
||||
if evttext.startswith(evt['component'] + ' - '):
|
||||
@ -83,4 +83,4 @@ for rsp in func('/noderange/{0}/events/hardware/log'.format(noderange)):
|
||||
if 'events' in thisdata:
|
||||
evtdata = thisdata['events']
|
||||
for evt in evtdata:
|
||||
print '{0}: {1}'.format(node, format_event(evt))
|
||||
print '{0}: {1}'.format(node, format_event(evt))
|
||||
|
Loading…
Reference in New Issue
Block a user