Skip to content

Commit c24770a

Browse files
committed
Fix examples
1 parent 862d336 commit c24770a

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

examples/add_machine.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ async def main():
3838
)
3939
# add a lxd container to machine2
4040
machine3 = await model.add_machine(
41-
'lxd:{}'.format(machine2.id))
41+
'lxd:{}'.format(machine2.id),
42+
series='xenial'
43+
)
4244

4345
# deploy charm to the lxd container
4446
application = await model.deploy(

examples/fullstatus.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
from juju import loop
2-
from juju.client.client import ClientFacade
3-
from juju.client.connection import Connection
2+
from juju.model import Model
43

54

65
async def status():
7-
conn = await Connection.connect()
8-
client = ClientFacade.from_connection(conn)
6+
model = Model()
7+
await model.connect()
98

10-
patterns = None
11-
status = await client.FullStatus(patterns)
12-
await conn.close()
9+
status = await model.get_status()
10+
await model.disconnect()
1311

1412
print('Applications:', list(status.applications.keys()))
1513
print('Machines:', list(status.machines.keys()))

0 commit comments

Comments
 (0)