canonical / canonical/charmed-openstack-upgrader
Support JUJU_CONTROLLER and JUJU_MODEL env vars
- Dominant language
- Python
- Stars
- 3
- Forks
- 12
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 1
Description
### Description
python lib juju doesn't support the env vars see: https://github.com/juju/python-libjuju/issues/909
Even that they don't support, COU can take those env vars and use the `[controller:][user/]model` syntax to [connect to the model](https://pythonlibjuju.readthedocs.io/en/latest/api/juju.model.html#juju.model.Model.connect). This will avoid users complaining that COU is not getting from the right model
### Charm revision
latest/stable
### Juju version
3.6
### Cloud
_No response_
### Expected behaviour
```
export JUJU_CONTROLLER=foundations-maas
export JUJU_MODEL=admin/openstack
cou plan #plan in openstack model without the need of switch
```
### Reproduce / Test
if you don't switch the controller/model cou will target the model that juju is pointing without considering the common Juju env vars
### Notes & References
_No response_
Contributor guide
Research direction
Start by tracing how COU's plan command selects the Juju controller and model, then compare that path with python-libjuju's Model.connect documentation. Implement support for JUJU_CONTROLLER and JUJU_MODEL using the controller/user/model syntax, and verify that cou plan targets the specified model without switching the active Juju model.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100