Commit 05f8991
committed
Derive the application status
With changes to juju, the application status was changed for the CLI to
use the model cache to derive the status of the application from the
unit status. Unfortunately the logic didn't reach the all watcher and in
doing so always reports the last application status.
Unfortunately the facade version wasn't bumped, which makes facade
checking for old and new logic almost impossible. Instead the solution
here is to always query the unit status, BUT add the application status
in to the derive_status() call so that we always buble the most relavant
serverity to the top.
This should happily work in a backwards compatibility way, so if the
application is blocked and any units are waiting, then the application
status will always win. Similarly if the units are blocked and the
application status is waiting, then blocked will be shown.
The one caveat is, that if the older juju didn't bubble up the worst
serverity to the application status, then you could end up with a
missmatch. For example; unit sets to error, but the application status
is waiting. Then juju CLI would show waiting, but pylibjuju would show
error.
I'm unsure if that is actually a fundamental problem, as I don't believe
it should happen, but in theory it should be at least known.1 parent 839a99f commit 05f8991
2 files changed
Lines changed: 23 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
79 | 81 | | |
80 | 82 | | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
88 | 87 | | |
89 | 88 | | |
90 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | | - | |
| 50 | + | |
52 | 51 | | |
53 | 52 | | |
54 | 53 | | |
| |||
60 | 59 | | |
61 | 60 | | |
62 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
63 | 77 | | |
64 | 78 | | |
65 | 79 | | |
| |||
0 commit comments