From 9562f43a108d17a263bf84bcc1aa96a8170586fa Mon Sep 17 00:00:00 2001 From: Adam Israel Date: Wed, 9 May 2018 13:55:28 -0400 Subject: [PATCH] Add workload message to callback Add the charm's workload status message to the callback so more detailed information can be provided to the user. Signed-off-by: Adam Israel Change-Id: I1bcd502a2470dd5a527bc88cf24f2e3e6753da91 --- n2vc/__init__.py | 2 +- n2vc/vnf.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/n2vc/__init__.py b/n2vc/__init__.py index 93353d0..889c3ab 100644 --- a/n2vc/__init__.py +++ b/n2vc/__init__.py @@ -1 +1 @@ -version = '0.0.1' +version = '0.0.2' diff --git a/n2vc/vnf.py b/n2vc/vnf.py index e39b04e..bd6b4f9 100644 --- a/n2vc/vnf.py +++ b/n2vc/vnf.py @@ -98,6 +98,7 @@ class VCAMonitor(ModelObserver): self.ns_name, delta.data['application'], new_status, + new.workload_status_message, *callback_args) if old and not new: @@ -107,6 +108,7 @@ class VCAMonitor(ModelObserver): self.ns_name, delta.data['application'], "removed", + "", *callback_args) except Exception as e: self.log.debug("[1] notify_callback exception {}".format(e)) @@ -212,10 +214,10 @@ class N2VC: """Close any open connections.""" yield self.logout() - def notify_callback(self, model_name, application_name, status, callback=None, *callback_args): + def notify_callback(self, model_name, application_name, status, message, callback=None, *callback_args): try: if callback: - callback(model_name, application_name, status, *callback_args) + callback(model_name, application_name, status, message, *callback_args) except Exception as e: self.log.error("[0] notify_callback exception {}".format(e)) raise e -- 2.25.1