X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=juju%2Fmodel.py;h=e56bfb41a209fd97d3930361b5b9136474178ede;hb=6a1c86e07844295a8a71d7c1935c35a8058fe15a;hp=480813c78a86298e1fde7ccaa704af0b47bf2ee0;hpb=2ed7314a9ea1240883655bc521b6e27f149aa485;p=osm%2FN2VC.git diff --git a/juju/model.py b/juju/model.py index 480813c..e56bfb4 100644 --- a/juju/model.py +++ b/juju/model.py @@ -53,7 +53,6 @@ class Model(object): self.connection = connection self.observers = set() self.state = dict() - self._watching = False @property def applications(self): @@ -63,10 +62,6 @@ class Model(object): def units(self): return self.state.get('unit', {}) - def stop_watching(self): - self.connection.cancel() - self._watching = False - def add_observer(self, callable_): """Register an "on-model-change" callback @@ -101,7 +96,7 @@ class Model(object): self._watching = True allwatcher = watcher.AllWatcher() allwatcher.connect(await self.connection.clone()) - while self._watching: + while True: results = await allwatcher.Next() for delta in results.deltas: delta = get_entity_delta(delta)