projects
/
osm
/
N2VC.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix formatting in docs
[osm/N2VC.git]
/
juju
/
model.py
diff --git
a/juju/model.py
b/juju/model.py
index
e56ad66
..
b97798a
100644
(file)
--- a/
juju/model.py
+++ b/
juju/model.py
@@
-390,6
+390,16
@@
class Model(object):
self._watch_received = asyncio.Event(loop=self.loop)
self._charmstore = CharmStore(self.loop)
self._watch_received = asyncio.Event(loop=self.loop)
self._charmstore = CharmStore(self.loop)
+ async def __aenter__(self):
+ await self.connect_current()
+ return self
+
+ async def __aexit__(self, exc_type, exc, tb):
+ await self.disconnect()
+
+ if exc_type is not None:
+ return False
+
async def connect(self, *args, **kw):
"""Connect to an arbitrary Juju model.
async def connect(self, *args, **kw):
"""Connect to an arbitrary Juju model.