Added juju.model.connect_model()
authorSean Feole <sean.feole@canonical.com>
Thu, 17 Nov 2016 20:53:44 +0000 (15:53 -0500)
committerSean Feole <sean.feole@canonical.com>
Thu, 17 Nov 2016 20:53:44 +0000 (15:53 -0500)
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.