2 This example doesn't work - it demonstrates features that don't exist yet.
8 from juju
.model
import Model
14 await model
.connect_current()
15 await model
.reset(force
=True)
17 goal_state
= Model
.from_yaml('bundle-like-thing')
18 ubuntu_app
= await model
.deploy(
20 application_name
='ubuntu',
24 ubuntu_app
.on_unit_added(callback
=lambda unit
: True)
28 application_name
='nrpe',
33 await model
.add_relation(
38 result
, ok
= await model
.block_until(
39 lambda: model
.matches(goal_state
),
44 if __name__
== '__main__':
45 logging
.basicConfig(level
=logging
.DEBUG
)
46 ws_logger
= logging
.getLogger('websockets.protocol')
47 ws_logger
.setLevel(logging
.INFO
)