Commit 64f91f1
authored
Merge pull request #710 from cderici/fix-facade-issues-2
#710
#### Description
This is PR complements #706, and tries to address the issues being discussed in #707, by updating the `old_client`s with `2.9.34` schema and fixing the `unit.run()` function to be asynchronous, as it's (breakingly) changed to be in the `Juju 3.0`. This also brings `unit.run` and `unit.run_action` functions very close, the only difference is that the former is using `Action.Run` while the latter is using `Action.Enqueue` functions. It's plausible that one of these ways of doing the similar thing will disappear in the future since the newer versions of `Action.Run` is asynchronous anyway.
Should fix the #707.
#### QA Steps
I updated the integration tests for `run()`, so basically all the tests in the following suite (that includes `test_run` and `test_run_action`) should pass:
```python
tox -e integration -- tests/integration/test_unit.py
```
Additionally I added the example that I have been using myself to test this into the examples folder, so it should be running fine:
```
$ python examples/run_action.py
```
Both the integration tests (`test_run` & `test_run_action`) and the example module are tested in the following controllers:
```
Controller Model User Access Cloud/Region Models Nodes HA Version
caner-k8s test admin superuser microk8s/localhost 2 - - 2.9.33
caner-k8s-2929 testhede admin superuser microk8s/localhost 2 - - 2.9.29
caner-k8s-2931 testhaylaz admin superuser microk8s/localhost 2 - - 2.9.31
caner-k8s-2934* haylazlar admin superuser microk8s/localhost 2 - - 2.9.34
caner-lxd-2.9 default admin superuser localhost/localhost 3 2 none 2.9.34.1
caner-lxd-2929 default admin superuser localhost/localhost 2 1 none 2.9.29
caner-lxd-2931 default admin superuser localhost/localhost 2 1 none 2.9.31
caner-lxd-2932 default admin superuser localhost/localhost 2 1 none 2.9.32
caner-lxd-3.0 canhiras admin superuser localhost/localhost 1 1 none 3.0-rc1.1
k8s-30 test4 admin superuser microk8s/localhost 2 - - 3.0-rc1
```
Note that, all the clients that I used `<2.9.34` are using the `ActionFacade v6`, and the ones `>=2.9.34` are using the `ActionFacade v7` (regardless of `2.9` vs` 3.0`).
#### Notes & Discussion
One of the requests was to keep the `unit.run()` function synchronous for any client using `<ActionFacade v6`. While this is a valid request from the user perspective, it also means that we would have the same function returning different types (either a dictionary or an action object) depending on the facade being used, which would make it way harder to maintain. That's why I kept the change for all the versions.15 files changed
Lines changed: 7404 additions & 2133 deletions
File tree
- examples
- juju
- client
- old_clients
- retired_schemas
- tests/integration
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
16 | 19 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
31 | | - | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | 49 | | |
51 | 50 | | |
52 | 51 | | |
| |||
260 | 259 | | |
261 | 260 | | |
262 | 261 | | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
263 | 266 | | |
264 | 267 | | |
265 | 268 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3610 | 3610 | | |
3611 | 3611 | | |
3612 | 3612 | | |
| 3613 | + | |
| 3614 | + | |
| 3615 | + | |
| 3616 | + | |
| 3617 | + | |
| 3618 | + | |
| 3619 | + | |
| 3620 | + | |
| 3621 | + | |
| 3622 | + | |
| 3623 | + | |
| 3624 | + | |
3613 | 3625 | | |
3614 | 3626 | | |
3615 | 3627 | | |
| |||
3736 | 3748 | | |
3737 | 3749 | | |
3738 | 3750 | | |
3739 | | - | |
| 3751 | + | |
3740 | 3752 | | |
3741 | 3753 | | |
3742 | 3754 | | |
| |||
6999 | 7011 | | |
7000 | 7012 | | |
7001 | 7013 | | |
7002 | | - | |
| 7014 | + | |
| 7015 | + | |
7003 | 7016 | | |
7004 | 7017 | | |
7005 | 7018 | | |
| |||
11858 | 11871 | | |
11859 | 11872 | | |
11860 | 11873 | | |
11861 | | - | |
| 11874 | + | |
| 11875 | + | |
11862 | 11876 | | |
11863 | 11877 | | |
11864 | 11878 | | |
11865 | 11879 | | |
11866 | 11880 | | |
11867 | 11881 | | |
| 11882 | + | |
11868 | 11883 | | |
11869 | 11884 | | |
11870 | 11885 | | |
| |||
11889 | 11904 | | |
11890 | 11905 | | |
11891 | 11906 | | |
11892 | | - | |
| 11907 | + | |
| 11908 | + | |
11893 | 11909 | | |
11894 | 11910 | | |
11895 | 11911 | | |
| |||
0 commit comments