Permalink
Cannot retrieve contributors at this time
Fetching contributors…
| """ | |
| This example: | |
| 1. Connects to the current model | |
| 2. Deploy a charm and waits until it reports itself active | |
| 3. Destroys the unit and application | |
| """ | |
| from juju import loop | |
| from juju.model import Model | |
| async def main(): | |
| model = Model() | |
| await model.connect_current() | |
| print('Deploying ubuntu') | |
| application = await model.deploy( | |
| 'ubuntu-0', | |
| application_name='ubuntu', | |
| series='trusty', | |
| channel='stable', | |
| ) | |
| print('Waiting for active') | |
| await model.block_until( | |
| lambda: all(unit.workload_status == 'active' | |
| for unit in application.units)) | |
| print('Removing ubuntu') | |
| await application.remove() | |
| loop.run(main) |