juju/python-libjuju

Code from example README throws ValueError: Some authentication parameters are required : password

Opened this issue · 4 comments

Description

The code from the example in README throws an error:

  File "/home/erik/test-annotate/venv/lib/python3.10/site-packages/juju/client/connector.py", line 99, in connect
    raise ValueError(f'Some authentication parameters are required : {",".join(required)}')
ValueError: Some authentication parameters are required : password

Urgency

Casually reporting

Python-libjuju version

3.5.2.0

Juju version

3.3.6

Reproduce / Test

1. Install libjuju into a venv.
2. Connect and make sure "juju status" works on the current model.
3. Copy code from README
4. Run the code.

I can use the lib if I'm putting together connection parameters like this:

    model = Model()
    # connect() doesn't work - try with parameters.
    # await model.connect()
    await model.connect(endpoint=_CONTROLLER['endpoint'],
                        username=_CONTROLLER['username'],
                        password=_CONTROLLER['password'],
                        uuid=model_uuid,
			cacert=_CONTROLLER['cacert'])

It also works if the account.yaml contains username + password.

model = Model()
# connect() doesn't work - try with parameters.
# await model.connect()
await model.connect(account="admin")

Maybe fixed by #1072.

Partially - but there are more issues which will surface if we use this with Macaroon based auth. We will update the issue mentioned in your post: #1072 and we can try to help you implement a fix. @hmlanigan @Aflynn50