Skip to content

Commit 9db01d8

Browse files
committed
Update readme
1 parent b584d27 commit 9db01d8

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

docs/readme.rst

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ ubuntu charm, then exits:
4848
import logging
4949
import sys
5050
51-
from juju import jasyncio
51+
from juju import asyncio
5252
from juju.model import Model
5353
5454
@@ -58,21 +58,20 @@ ubuntu charm, then exits:
5858
model = Model()
5959
6060
# Connect to the currently active Juju model
61-
await model.connect_current()
61+
await model.connect()
6262
6363
try:
6464
# Deploy a single unit of the ubuntu charm, using the latest revision
6565
# from the stable channel of the Charm Store.
6666
ubuntu_app = await model.deploy(
6767
'ubuntu',
6868
application_name='ubuntu',
69-
series='xenial',
70-
channel='stable',
7169
)
7270
7371
if '--wait' in sys.argv:
7472
# optionally block until the application is ready
75-
await model.block_until(lambda: ubuntu_app.status == 'active')
73+
await model.wait_for_idle(status = 'active')
74+
7675
finally:
7776
# Disconnect from the api server and cleanup.
7877
await model.disconnect()
@@ -87,7 +86,7 @@ ubuntu charm, then exits:
8786
8887
# Run the deploy coroutine in an asyncio event loop, using a helper
8988
# that abstracts loop creation and teardown.
90-
jasyncio.run(deploy())
89+
asyncio.run(deploy())
9190
9291
9392
if __name__ == '__main__':

0 commit comments

Comments
 (0)