Merge "Doctor datasource - severity is not mandatory"

This commit is contained in:
Jenkins 2017-02-16 11:49:52 +00:00 committed by Gerrit Code Review
commit 7d451e6113
2 changed files with 3 additions and 1 deletions

View File

@ -57,7 +57,6 @@ class DoctorDriver(AlarmDriverBase):
details = alarm[EventProps.DETAILS]
return DoctorDetails.STATUS in details and \
DoctorDetails.SEVERITY in details and \
DoctorDetails.HOSTNAME in details
def _status_changed(self, new_alarm, old_alarm):

View File

@ -48,6 +48,9 @@ class DoctorTransformer(AlarmTransformerBase):
details = entity_event.get(EventProps.DETAILS, {})
details[VProps.NAME] = entity_event[EventProps.TYPE]
details[EventProps.TIME] = entity_event[EventProps.TIME]
if DoctorDetails.SEVERITY not in details:
LOG.debug('adding default severity - CRITICAL')
details[DoctorDetails.SEVERITY] = 'critical'
return graph_utils.create_vertex(
self._create_entity_key(entity_event),