Merge pull request #11 from sfeole/add-connect_model
authorTim Van Steenburgh <tvansteenburgh@gmail.com>
Thu, 17 Nov 2016 21:01:28 +0000 (16:01 -0500)
committerGitHub <noreply@github.com>
Thu, 17 Nov 2016 21:01:28 +0000 (16:01 -0500)
Added juju.model.connect_model()

juju/model.py

index 5ca7422..9d14f82 100644 (file)
@@ -367,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:  <controller>:<user/model>
+
+        """
+        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.