Merge lp://staging/~fwereade/pyjuju/restrict-relation-broken-context into lp://staging/pyjuju
Proposed by
William Reade
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Kapil Thangavelu | ||||
Approved revision: | 433 | ||||
Merged at revision: | 449 | ||||
Proposed branch: | lp://staging/~fwereade/pyjuju/restrict-relation-broken-context | ||||
Merge into: | lp://staging/pyjuju | ||||
Diff against target: |
935 lines (+398/-244) 6 files modified
juju/state/errors.py (+4/-0) juju/state/hook.py (+73/-7) juju/state/tests/test_errors.py (+7/-1) juju/state/tests/test_hook.py (+244/-175) juju/unit/lifecycle.py (+67/-56) juju/unit/tests/test_lifecycle.py (+3/-5) |
||||
To merge this branch: | bzr merge lp://staging/~fwereade/pyjuju/restrict-relation-broken-context | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Benjamin Saller (community) | Approve | ||
Kapil Thangavelu (community) | Approve | ||
Review via email: mp+85267@code.staging.launchpad.net |
Description of the change
Part 1 extracted from the horrifyingly overgrown restart-transitions branch:
relation-broken hooks now execute in a more constrained environment than do normal relation hooks (same things accessible, but with less functionality).
To post a comment you must log in.
Nice work, some minors.
[0]
Cache instance attributes could always use a documentation line on
what's being cached.
hook.py line 269
self._relation_ cache = None
[1]
set_value/set
return fail(NotImpleme ntedError(
"Cannot change settings in broken relation"))
That doesn't seem like the appropriate error in this ontextError
context. Something more specific to the problem at hand seems
appropriate, ie. RelationBrokenC
[2] pep8 nags, trailing newline at EOF, over 80 (unrelated to diff) in hook.py
unit_state = yield service_ state_manager. get_unit_ state(self. _unit_name)
[3]
seems like the mixin here should be merged into hookcontexttest base,
all the tests have the same pair of base classes.
HookContextTest (HookContextTes tBase, CommonHookConte xtTestsMixin) :