Add workload message to callback 09/6109/2
authorAdam Israel <adam.israel@canonical.com>
Wed, 9 May 2018 17:55:28 +0000 (13:55 -0400)
committerAdam Israel <adam.israel@canonical.com>
Thu, 10 May 2018 12:14:52 +0000 (08:14 -0400)
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 <adam.israel@canonical.com>
Change-Id: I1bcd502a2470dd5a527bc88cf24f2e3e6753da91

n2vc/__init__.py
n2vc/vnf.py

index 93353d0..889c3ab 100644 (file)
@@ -1 +1 @@
-version = '0.0.1'
+version = '0.0.2'
index e39b04e..bd6b4f9 100644 (file)
@@ -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