Resolved bug 1047. 31/8831/12
authorAtul Agarwal <atul.agarwal@altran.com>
Tue, 28 Apr 2020 10:12:28 +0000 (15:42 +0530)
committerbeierlm <mark.beierl@canonical.com>
Tue, 28 Apr 2020 16:30:28 +0000 (12:30 -0400)
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>
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
 # *************************************************************