Commit 34981c5
authored
Merge pull request #698 from cderici/fix-run-actions-on-units
#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.2 files changed
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
| 167 | + | |
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
173 | | - | |
| 172 | + | |
| 173 | + | |
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
179 | | - | |
| 179 | + | |
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
| |||
0 commit comments