Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1003 from cderici/no-contr-model-access-needed-fo…
…r-connection #1003 #### Description This is a follow up PR, includes changes from #1002. If you're reviewing this and #1002 hasn't landed yet, you might see some additional changes that'll land with #1002. We need those changes to be able to test this change. `ControllerAPIInfoForModels` call in `update_endpoints` after a controller connection requires the `uuid` of the controller model, and if the user doesn't have at least read access, they won't be able to have that, so the `update_endpoint` call at the end of a regular connection fails. Fixes #998 #### QA Steps We'll need a 2.9 controller, so: ``` $ juju_29 bootstrap localhost issue998 ``` Now we have the admin user on this by default, but we don't wanna use that. Let's create a new user (that doesn't have superuser so it can't read the controller model): ```sh $ juju add-user caner $ juju register ``` Now let's make a password for this user. ```sh $ juju change-user-password # to be able to access the admin user later $ juju logout $ juju login -u caner -c issue998 $ juju change-user-password <your-password> This should work just fine, we're just making sure the user is ready to go. ``` Now let's spawn a pylibjuju repl to test this change with this user (that can't access the `controller` model): Wihtout this change, you'd see the error in #998. With this change the connection should work just fine: ```python # cd pylibjuju directory $ python -m asyncio >>> from juju import controller; c=controller.Controller() >>> await c.connect(username='caner', password=<your-password>) >>> exiting asyncio REPL... # Connection works without any issues. ``` #### Notes & Discussion JUJU-5268
- Loading branch information