Skip to content

Commit 9e1409a

Browse files
authored
Merge pull request #416 from hpidcock/fix-2.8
#416 - Fix tox.ini to use supported python versions. - Fix contraints regex using subscript on matches (py36). - Fix facade return type documentation. - Fix schema objects with array values. - Fix subscript lookups by using JSON keys. - Add definition test. Addresses #413 #414
2 parents fe1e4cc + c24770a commit 9e1409a

21 files changed

Lines changed: 1814 additions & 1738 deletions

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)