4 1. Connects to the current model
5 2. Deploy a charm and waits until it reports itself active
6 3. Destroys the unit and application
10 from juju
.model
import Model
15 print('Connecting to model')
16 # connect to current model with current user, per Juju CLI
20 print('Deploying ubuntu')
21 application
= await model
.deploy(
23 application_name
='ubuntu',
28 print('Waiting for active')
29 await model
.block_until(
30 lambda: all(unit
.workload_status
== 'active'
31 for unit
in application
.units
))
33 print('Removing ubuntu')
34 await application
.remove()
36 print('Disconnecting from model')
37 await model
.disconnect()
40 if __name__
== '__main__':