X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=juju%2Fmodel.py;h=9d14f82bb0b76775d6471140b05cdaf422ee7e43;hb=fa674e918e3298eb00eb036b94a39a8b16a21198;hp=db65b7d1eca5fa1af1e0c988ba7d2cea88faedf6;hpb=c8d7bcea7e1fd4b174e3be2a29e382df66e88b66;p=osm%2FN2VC.git diff --git a/juju/model.py b/juju/model.py index db65b7d..9d14f82 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. @@ -357,6 +367,15 @@ class Model(object): self._watch() await self._watch_received.wait() + async def connect_model(self, arg): + """Connect to a specific Juju model. + :param arg: : + + """ + self.connection = await connection.Connection.connect_model(arg) + self._watch() + await self._watch_received.wait() + async def disconnect(self): """Shut down the watcher task and close websockets.