Merge lp:~jimbaker/pyjuju/new-hook-semantics-1-departed-hook into lp:pyjuju
Status: | Merged |
---|---|
Approved by: | Kapil Thangavelu |
Approved revision: | 181 |
Merged at revision: | 189 |
Proposed branch: | lp:~jimbaker/pyjuju/new-hook-semantics-1-departed-hook |
Merge into: | lp:pyjuju |
Diff against target: |
106 lines (+40/-24) 2 files modified
ensemble/unit/lifecycle.py (+27/-21) ensemble/unit/tests/test_lifecycle.py (+13/-3) |
To merge this branch: | bzr merge lp:~jimbaker/pyjuju/new-hook-semantics-1-departed-hook |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Kapil Thangavelu (community) | Approve | ||
Gustavo Niemeyer | Approve | ||
Review via email: mp+55383@code.launchpad.net |
Description of the change
Adds a <name>-
<name<-
add this new hook semantic (and the other aspects, to be introduced in
future branches) is in UnitRelationCyc
ensemble.
hooks corresponding to a given change. So in the case of a departed
event:
if change.change_type == "departed":
A subsequent branch will remove the above <name>-
It looks good to me, but please wait for Kapil's review since he
knows more about this area.
Some minor comments as well:
[1]
+ self._log. debug(" %s: executing change hook", self._relation_ name)
This log message seems incorrect now. It should probably be something like
"Executing hook %s" % hook_name
Please do something similar to the other log messages.
[2]
51 + if not self._error_ handler:
52 + raise
It's not entirely clear to me that this is correct. Do we really want
to ignore the other hook when this happens?
[3]
# Queue up our wait condition, of 3 hooks firing
s/3/4/
[4]
84 + "app-relation- changed" , changed" , "app-relation- departed" ]) changed" , "app-relation- departed" , changed" ])
85 + "app-relation-
(...)
96 + "start",
97 + "app-relation-
98 + "app-relation-
Please organize the lists evenly.
[5]
+ ("#!/bin/bash\n" "echo departed >> %s\n" % (file_path)))
Please remove the parenthesis around file_path in both cases. They're
are not doing anything.