Coverity-CWE 330: Use of Insufficiently Random Values (137944 Cryptographically weak...
[osm/POL.git] / osm_policy_module / alarming / service.py
index f5a5d9e..f3a316d 100644 (file)
@@ -128,6 +128,8 @@ class AlarmingService:
                                     threshold=alarm_descriptor["value"],
                                     operation=alarm_descriptor["operation"],
                                     action=str(alarm_action),
+                                    vnfr=vnfr,
+                                    vnfd=vnfd,
                                 )
                                 alarm = VnfAlarmRepository.create(
                                     alarm_id=alarm_descriptor["alarm-id"],
@@ -271,7 +273,14 @@ class AlarmingService:
                                     status,
                                 )
                                 try:
-                                    if status == "alarm" and alarm.last_action == "ok":
+                                    if (
+                                        status == "alarm"
+                                        and alarm.last_action == "ok"
+                                        or (
+                                            status == "alarm"
+                                            and alarm.last_action == "insufficient-data"
+                                        )
+                                    ):
                                         alarm.id_suffix += 1
                                         alarm.ok_ack = False
                                     if status == "ok" and alarm.last_action == "alarm":