From: Atul Agarwal Date: Tue, 28 Apr 2020 10:12:28 +0000 (+0530) Subject: Resolved bug 1047. X-Git-Tag: v7.1.0rc3 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=8d5d52e48cd0dca4be31367efb83b1890397b0e7;p=osm%2FPOL.git Resolved bug 1047. Adds # pylint: disable=no-member due to dynamic creation of VNF alarm member. Change-Id: I7ce58193e60847699777521c115384fde1ca6ec4 Signed-off-by: Atul Agarwal (cherry picked from commit db8c10583609ed19063b0330059201b8753a31ef) --- diff --git a/osm_policy_module/alarming/service.py b/osm_policy_module/alarming/service.py index e45787e..0200a71 100644 --- a/osm_policy_module/alarming/service.py +++ b/osm_policy_module/alarming/service.py @@ -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: diff --git a/osm_policy_module/autoscaling/service.py b/osm_policy_module/autoscaling/service.py index e0ab9cb..f6f71c2 100644 --- a/osm_policy_module/autoscaling/service.py +++ b/osm_policy_module/autoscaling/service.py @@ -1,4 +1,5 @@ # -*- coding: utf-8 -*- +# pylint: disable=no-member # Copyright 2018 Whitestack, LLC # *************************************************************