Doctor datasource - severity is not mandatory

Change-Id: I9cb5082b85deb43d8b4c16f3e277a7ab32899f6c
This commit is contained in:
Ifat Afek 2017-02-15 15:28:03 +00:00
parent 1c1fbb4cc7
commit 47b97c7e7c
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),