Remove dependency on onaplogging in vnflcm
[vfc/gvnfm/vnflcm.git] / lcm / lcm / pub / utils / notificationsutil.py
index 936cc5b..fcc7ef9 100644 (file)
@@ -52,7 +52,8 @@ class NotificationsUtil(object):
         logger.info("Send Notifications to the callbackUri")
         filters = {
             "operationState": "operation_states",
-            "operation": "operation_types"
+            "operation": "operation_types",
+            "vnfInstanceId": "vnf_instance_filter"
         }
         subscriptions_filter = {v + "__contains": notification[k] for k, v in list(filters.items())}
 
@@ -117,7 +118,7 @@ class NotificationsUtil(object):
                     raise ex
         except urllib.error.URLError as err:
             ret = [2, str(err), resp_status, resp_Location]
-        except Exception as ex:
+        except Exception:
             logger.error(traceback.format_exc())
             logger.error("[%s]ret=%s" % (callid, str(sys.exc_info())))
             res_info = str(sys.exc_info())
@@ -246,7 +247,7 @@ def prepare_notification(nfinstid, jobid, operation, operation_state):
         'affectedVirtualLinks': [],
         'affectedVirtualStorages': [],
         'changedExtConnectivity': [],
-        'error': '',
+        'error': None,
         '_links': {
             'vnfInstance': {
                 'href': '%s/vnf_instances/%s' % (const.URL_PREFIX, nfinstid)