From: Zhang Rong(Jon) Date: Thu, 24 Nov 2022 06:39:06 +0000 (+0800) Subject: Fix INF-381 alarm watcher failed to audit alarm X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=60034d77380cf7d11ca28d292df3f93a601d1568;p=pti%2Fo2.git Fix INF-381 alarm watcher failed to audit alarm Issue-ID: INF-381 Signed-off-by: Zhang Rong(Jon) Change-Id: Ie1e1ce8f2b3e4d7cda0c9024b909efda378725ce --- 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