From: Adam Israel Date: Tue, 9 Apr 2019 20:07:53 +0000 (-0400) Subject: Fix bug 659: Don't use static member variables X-Git-Tag: v6.0.0~12 X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FN2VC.git;a=commitdiff_plain;h=d420a8b6f1fecde3983369b131da1f042c7c8a14;hp=b2c234b2056b9d8cb9f6eda268c2cf1845f88371 Fix bug 659: Don't use static member variables This fixes bug 659, where static member variables were used by the VCAMonitor, causing unexpected behaviour when deploying and destroying a network service multiple times. Change-Id: Icc5e4da62aeb11e4c89ba3cf5f148c6959acf7e3 Signed-off-by: Adam Israel --- diff --git a/n2vc/vnf.py b/n2vc/vnf.py index 1bdfe2f..a486f27 100644 --- a/n2vc/vnf.py +++ b/n2vc/vnf.py @@ -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: