From 1b2df922f29c611671f1fb05164016d23a55dfc8 Mon Sep 17 00:00:00 2001 From: Tim Van Steenburgh Date: Thu, 17 Nov 2016 09:56:01 -0500 Subject: [PATCH] Add Model.connect() for connecting to arbitrary endpoint --- juju/model.py | 10 ++++++++++ 1 file changed, 10 insertions(+) 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. -- 2.25.1