From 7470364541fc71f7a8c019e948f344a84fa332d4 Mon Sep 17 00:00:00 2001 From: "Zhang Rong(Jon)" Date: Thu, 24 Nov 2022 14:39:06 +0800 Subject: [PATCH] Fix INF-381 alarm watcher failed to audit alarm Issue-ID: INF-381 Signed-off-by: Zhang Rong(Jon) Change-Id: Ie1e1ce8f2b3e4d7cda0c9024b909efda378725ce --- o2ims/service/auditor/alarm_handler.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/o2ims/service/auditor/alarm_handler.py b/o2ims/service/auditor/alarm_handler.py index 36be48f..e24e4c9 100644 --- a/o2ims/service/auditor/alarm_handler.py +++ b/o2ims/service/auditor/alarm_handler.py @@ -61,7 +61,8 @@ def update_alarm( 'resourceTypeId': restype.resourceTypeId }) for host in hosts: - if host.name == hostname: + extensions = json.loads(host.extensions) + if extensions['hostname'] == hostname: localmodel.resourceId = host.resourceId uow.alarm_event_records.add(localmodel) logger.info("Add the alarm event record: " + fmobj.id -- 2.16.6