Merge lp:~adam-collard/charm-helpers/status-get-message into lp:charm-helpers
Proposed by
Adam Collard
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 435 | ||||
Proposed branch: | lp:~adam-collard/charm-helpers/status-get-message | ||||
Merge into: | lp:charm-helpers | ||||
Diff against target: |
72 lines (+19/-15) 2 files modified
charmhelpers/core/hookenv.py (+11/-9) tests/core/test_hookenv.py (+8/-6) |
||||
To merge this branch: | bzr merge lp:~adam-collard/charm-helpers/status-get-message | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Chris Glass (community) | Approve | ||
Review via email:
|
Description of the change
Change status_get() to return both the status and the message associated with it. This makes status_
I searched the whole charmstore for files in hooks/ which used status_get() and weren't in charmhelpers itself. Only the Cassandra charm was using it, and I have filed bug 1489120 pre-emptively to note the failure.
To post a comment you must log in.
Thanks for your branch.
I think in this particular case it would be better to simply return a 2-tuple with the message every time. I see no reason not to, and adding switches that default to a non-ideal behavior seems broken to me.
Since none of the charms I grep'd use this method (yet?), I would go for breaking and not being backwards compatible.
In other words, make status_get() not take a parameter, and always pass --include-data, returning a 2-tuple. Bonus points for making it an explicit 2-tuple so future readers see it right away.