From: Tim Van Steenburgh Date: Thu, 17 Nov 2016 14:56:01 +0000 (-0500) Subject: Add Model.connect() for connecting to arbitrary endpoint X-Git-Tag: 0.1.0~50 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=1b2df922f29c611671f1fb05164016d23a55dfc8;p=osm%2FN2VC.git Add Model.connect() for connecting to arbitrary endpoint --- diff --git a/juju/model.py b/juju/model.py index db65b7d..5ca7422 100644 --- a/juju/model.py +++ b/juju/model.py @@ -349,6 +349,16 @@ class Model(object): self._watch_received = asyncio.Event(loop=loop) self._charmstore = CharmStore(self.loop) + async def connect(self, *args, **kw): + """Connect to an arbitrary Juju model. + + args and kw are passed through to Connection.connect() + + """ + self.connection = await connection.Connection.connect(*args, **kw) + self._watch() + await self._watch_received.wait() + async def connect_current(self): """Connect to the current Juju model.