Resolved bug 1047. 12/8912/1 v7.1.0 v7.1.0rc1 v7.1.0rc2 v7.1.0rc3 v7.1.0rc4 v7.1.0rc5 v7.1.0rc6
authorAtul Agarwal <atul.agarwal@altran.com>
Tue, 28 Apr 2020 10:12:28 +0000 (15:42 +0530)
committerpalsus <subhankar.pal@altran.com>
Wed, 13 May 2020 11:11:05 +0000 (13:11 +0200)
Adds # pylint: disable=no-member due to dynamic creation of VNF
alarm member.

Change-Id: I7ce58193e60847699777521c115384fde1ca6ec4
Signed-off-by: Atul Agarwal <atul.agarwal@altran.com>
(cherry picked from commit db8c10583609ed19063b0330059201b8753a31ef)

osm_policy_module/alarming/service.py
osm_policy_module/autoscaling/service.py

index e45787e..0200a71 100644 (file)
@@ -1,4 +1,5 @@
 # -*- coding: utf-8 -*-
+# pylint: disable=no-member
 
 # Copyright 2018 Whitestack, LLC
 # *************************************************************
@@ -26,6 +27,7 @@ import json
 import logging
 
 import requests
+from requests.exceptions import ConnectionError
 
 from osm_policy_module.common.common_db_client import CommonDbClient
 from osm_policy_module.common.lcm_client import LcmClient
@@ -187,7 +189,11 @@ class AlarmingService:
                     if action.type == status:
                         log.info("Executing request to url %s for vnf alarm %s with status %s", action.url,
                                  alarm.alarm_id, status)
-                        requests.post(url=action.url, json=json.dumps(payload))
+                        try:
+                            requests.post(url=action.url, json=json.dumps(payload))
+                        except ConnectionError:
+                            log.exception("Error connecting to url %s", action.url)
+
         except VnfAlarm.DoesNotExist:
             log.debug("There is no alarming action configured for alarm %s.", alarm_uuid)
         finally:
index e0ab9cb..f6f71c2 100644 (file)
@@ -1,4 +1,5 @@
 # -*- coding: utf-8 -*-
+# pylint: disable=no-member
 
 # Copyright 2018 Whitestack, LLC
 # *************************************************************