Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JUJU-1534] Fix model.connect_current() #697

Merged
merged 3 commits into from
Aug 2, 2022

Conversation

cderici
Copy link
Contributor

@cderici cderici commented Aug 1, 2022

Description

This PR fixes the model.connect_current() call which currently fails at the after_connect where we pull up the model info. The reason of the failure is that we neither have a model_name, nor a model_uuid for the controller to pull up the info. To solve it, this change gets the model_uuid from the connector during connect (if we don't use the endpoints, in which case we don't have a problem to begin with).

QA Steps

This change also introduces an integration test, namely, test_connect_current, so the following should pass.

tox -e integration -- tests/integration/test_model.py::test_connect_current

Notes & Discussion

@cderici
Copy link
Contributor Author

cderici commented Aug 1, 2022

Looks like some of the integration test jobs are created with the snap install lxd --channel=4.24/stable, while some of them are updated and doing just snap install lxd, despite that the PR juju/juju-qa-jenkins#52 for that is merged and new jobs are pushed.

Manually changing job scripts (to be overwritten at the next push) for now. /build

@cderici
Copy link
Contributor Author

cderici commented Aug 1, 2022

/build

@cderici cderici mentioned this pull request Aug 1, 2022
1 task
Copy link
Contributor

@juanmanuel-tirado juanmanuel-tirado left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG2M

@juanmanuel-tirado
Copy link
Contributor

Some tests are still running random issues. I will ignore and proceed with the merge.

@juanmanuel-tirado
Copy link
Contributor

/merge

@jujubot jujubot merged commit 3c31d0a into juju:master Aug 2, 2022
jujubot added a commit that referenced this pull request Aug 2, 2022
#698

#### Description

This changes the function that's used for running an action on a unit from `Action.Enqueue` to `Action.EnqueueOperation`, because it's the most up to date one and also the former one is deprecated in `Action v7` facade.

- [ ] Should be merged after #697 has landed.

#### QA Steps

The qa steps I followed were with a k8s model. So get a controller on a k8s cloud. 
The following then should work fine.

```python
async def _get_password():
 model = Model()
 await model.connect()
 await model.deploy('zinc-k8s')
 await model.wait_for_idle(status="active")

 unit = model.applications['zinc-k8s'].units[0]
 action = await unit.run_action("get-admin-password")
 results = await action.wait()
 print(results["admin-password"])
 await model.disconnect()
```

#### Notes & Discussion

* Maybe we should also add an integration test with an example action to make sure we won't regress from this in the future.
jujubot added a commit that referenced this pull request Aug 9, 2022
#704

Tuesday August 9 2022

## What's Changed

Switching to semantic versioning. From this release on, at least the major release number matches
the most recent Juju supported. Hence the jump to `3.0.0` since this release supports `Juju 3.0`.
(This also means that `python-libjuju <= 2.9.11` only support up to `Juju 2.x`)

* [JUJU-1439] Initial fixes for `test_model` to pass with juju 3.0 by @cderici in #689
* [JUJU-1464] More fixes for 3.0 compatibility by @cderici in #691
* [JUJU-1457] Merge 3.0 compatibility branch onto master by @cderici in #692
* Fix conditional by @sed-i in #696
* [JUJU-1534] Fix `model.connect_current()` by @cderici in #697
* [JUJU-1542] Fix run actions on units by @cderici in #698
* [JUJU-1577] Replace k8s bundles with machine bundles for tests by @cderici in #703
* [JUJU-1528] Add storage implementation by @cderici in #701

[JUJU-1439]: https://warthogs.atlassian.net/browse/JUJU-1439?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[JUJU-1464]: https://warthogs.atlassian.net/browse/JUJU-1464?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[JUJU-1457]: https://warthogs.atlassian.net/browse/JUJU-1457?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[JUJU-1534]: https://warthogs.atlassian.net/browse/JUJU-1534?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[JUJU-1542]: https://warthogs.atlassian.net/browse/JUJU-1542?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[JUJU-1577]: https://warthogs.atlassian.net/browse/JUJU-1577?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[JUJU-1528]: https://warthogs.atlassian.net/browse/JUJU-1528?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
@cderici cderici deleted the fix-no-model-name-case branch August 9, 2022 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants