libjuju with jem key error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Triaged
|
Low
|
Unassigned |
Bug Description
I have installed libjuju:
(venv) sssler@
juju==2.8.4
jujubundlelib=
macaroonbakery=
...
I've copied the example and modified it for our jimm/jem environment (jimm.example.com):
"""
This example:
1. Connects to current controller.
2. Creates a new model.
3. Deploys an application on the new model.
4. Disconnects from the model
5. Destroys the model
"""
import logging
from juju.controller import Controller
from juju import loop
async def main():
controller = Controller()
# connect to current controller with current user, per Juju CLI
await controller.
model = await controller.
)
await model.deploy(
'ubuntu-0',
)
await model.disconnect()
await controller.
await controller.
if __name__ == '__main__':
logging.
ws_logger = logging.
ws_
loop.
When running the code
$ python3 controller-test.py
....
}, {'model': {'name': 'test-slurm-
Traceback (most recent call last):
File "controller-
loop.
File "/home/
raise task.exception()
File "controller-
await controller.
File "/home/
await self.update_
File "/home/
info = await self.info()
File "/home/
params = [client.
KeyError: 'controller'
I'm lost here.
My client sees the controller:
$ juju controllers
Use --refresh option with this command to see the latest information.
Controller Model User Access Cloud/Region Models Nodes HA Version 1 - - 2.8.3
jimm.example.com* libjuju MYUSER@example (unknown) 33 - - 2.8.1
description: | updated |
Changed in juju: | |
importance: | Undecided → Medium |
status: | New → Triaged |
tags: | added: jaas python-libjuju |
I tried this code too with no luck:
(venv) sssler@ dcv-engineering :~/model- libjuju$ cat model.py
"""
This example shows how to reconnect to a model if you encounter an error
1. Connects to current model.
2. Attempts to get an application that doesn't exist.
3. Disconnect then reconnect.
"""
from juju import loop
from juju.model import Model
async def main(): current( ) applications)
model = Model()
await model.connect_
# print(model.
await model.disconnect()
if __name__ == '__main__': run(main( ))
loop.
(venv) sssler@ dcv-engineering :~/model- libjuju$ python3 model.py Task.start. <locals> .run() done, defined at /home/sssler/ model-libjuju/ venv/lib/ python3. 6/site- packages/ juju/client/ connection. py:785> exception= Exception( 'No facade Pinger in facades {}',)> sssler/ model-libjuju/ venv/lib/ python3. 6/site- packages/ juju/client/ connection. py", line 787, in run sssler/ model-libjuju/ venv/lib/ python3. 6/site- packages/ juju/client/ connection. py", line 411, in _pinger PingerFacade. from_connection (self) sssler/ model-libjuju/ venv/lib/ python3. 6/site- packages/ juju/client/ _client. py", line 65, in from_connection facades) ) Task.start. <locals> .run() done, defined at /home/sssler/ model-libjuju/ venv/lib/ python3. 6/site- packages/ juju/client/ connection. py:785> exception= Exception( 'No facade Pinger in facades {}',)> sssler/ model-libjuju/ venv/lib/ python3. 6/site- packages/ juju/client/ connection. py", line 787, in run sssler/ model-libjuju/ venv/lib/ python3. 6/site- packages/ juju/client/ connection. py", line 411, in _pinger PingerFacade. from_connection (self) sssler/ model-libjuju/ venv/lib/ python3. 6/site- packages/ juju/client/ _client. py", line 65, in from_connection facades) ) sssler/ model-libjuju/ venv/lib/ python3. 6/site- packages/ juju/model. py", line 849, in _all_watcher connection( )) sssler/ model-libjuju/ venv/lib/ python3. 6/site- packages/ juju/client/ _client. py", line 65, in from_connection facades) ) _watch. <locals> ._all_watcher( ) done, defined at /home/sssler/ model-libjuju/ venv/lib/ python3. 6/site- packages/ juju/model. py:846> exception= Exception( 'No facade AllWatcher in facades {}',)> sssler/ model-libjuju/ venv/lib/ python3. 6/site- packages/ juju/model. py", line 849, in _all_watcher connection( )) sssler/ model-libjuju/ venv/lib/ python3. 6/site- packages/ juju/client/ _client. py", line 65, in from_connection facades) )
Task exception was never retrieved
future: <Task finished coro=<_
Traceback (most recent call last):
File "/home/
return await self.task()
File "/home/
pinger_facade = client.
File "/home/
connection.
Exception: No facade Pinger in facades {}
Task exception was never retrieved
future: <Task finished coro=<_
Traceback (most recent call last):
File "/home/
return await self.task()
File "/home/
pinger_facade = client.
File "/home/
connection.
Exception: No facade Pinger in facades {}
Error in watcher
Traceback (most recent call last):
File "/home/
self.
File "/home/
connection.
Exception: No facade AllWatcher in facades {}
Task exception was never retrieved
future: <Task finished coro=<Model.
Traceback (most recent call last):
File "/home/
self.
File "/home/
connection.
Exception: No facade AllWatcher in facades {}