Squashed 'modules/libjuju/' content from commit c50c361
git-subtree-dir: modules/libjuju
git-subtree-split: c50c361a8b9a3bbf1a33f5659e492b481f065cd2
diff --git a/examples/localcharm.py b/examples/localcharm.py
new file mode 100644
index 0000000..978703e
--- /dev/null
+++ b/examples/localcharm.py
@@ -0,0 +1,34 @@
+"""
+This example shows how to deploy a local charm. It:
+
+1. Connects to current model.
+2. Uploads a local charm (directory on filesystem) to the model.
+3. Deploys the uploaded charm.
+
+"""
+import asyncio
+import logging
+
+from juju.model import Model
+from juju import loop
+
+
+async def main():
+ model = Model()
+ await model.connect_current()
+
+ # Deploy a local charm using a path to the charm directory
+ await model.deploy(
+ '/home/tvansteenburgh/src/charms/ubuntu',
+ application_name='ubuntu',
+ series='trusty',
+ )
+
+ await model.disconnect()
+
+
+if __name__ == '__main__':
+ logging.basicConfig(level=logging.DEBUG)
+ ws_logger = logging.getLogger('websockets.protocol')
+ ws_logger.setLevel(logging.INFO)
+ loop.run(main())