Comment 3 for bug 1981833

Revision history for this message
Natasha Ho (natashaho) wrote :

Following up on the admission-webhook example. I tried connecting to the model using libjuju. The app and unit are in active state according to libjuju, while `juju status` shows error or waiting statuses.
```
>>> from juju import jasyncio
>>> from juju.model import Model
>>> async def connect_current_model():
... model = Model()
... try:
... # connect to the current model with the current user, per the Juju CLI
... await model.connect()
... print('There are {} applications'.format(len(model.applications)))
... return model
... except:
... print("Failed to connect")
...
>>> current_model = jasyncio.run(connect_current_model())
>>> current_model.state.applications['admission-webhook'].status
'active'
>>> current_model.state.units['admission-webhook/0'].agent_status
'idle'
>>> current_model.state.units['admission-webhook/0'].workload_status
'active'
```