Fix bug 659: Don't use static member variables
[osm/N2VC.git] / n2vc / vnf.py
index 9cdbb33..a486f27 100644 (file)
@@ -57,13 +57,12 @@ logging.getLogger('juju.machine').setLevel(logging.WARN)
 class VCAMonitor(ModelObserver):
     """Monitor state changes within the Juju Model."""
     log = None
-    ns_name = None
-    applications = {}
 
     def __init__(self, ns_name):
         self.log = logging.getLogger(__name__)
 
         self.ns_name = ns_name
+        self.applications = {}
 
     def AddApplication(self, application_name, callback, *callback_args):
         if application_name not in self.applications:
@@ -769,11 +768,11 @@ class N2VC:
 
                 await self.disconnect_model(self.monitors[model_name])
 
-                # Notify the callback that this charm has been removed.
                 self.notify_callback(
                     model_name,
                     application_name,
                     "removed",
+                    "Removing charm {}".format(application_name),
                     callback,
                     *callback_args,
                 )
@@ -823,7 +822,7 @@ class N2VC:
 
         # Do not delete the default model. The default model was used by all
         # Network Services, prior to the implementation of a model per NS.
-        if ns_uuid.lower() is "default":
+        if ns_uuid.lower() == "default":
             return False
 
         if not self.authenticated:
@@ -836,7 +835,7 @@ class N2VC:
 
         try:
             await self.controller.destroy_models(ns_uuid)
-        except JujuError as e:
+        except JujuError:
             raise NetworkServiceDoesNotExist(
                 "The Network Service '{}' does not exist".format(ns_uuid)
             )