Merge lp://staging/~hazmat/pyjuju/status-w-peers into lp://staging/pyjuju
Proposed by
Kapil Thangavelu
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Gustavo Niemeyer | ||||
Approved revision: | 264 | ||||
Merged at revision: | 265 | ||||
Proposed branch: | lp://staging/~hazmat/pyjuju/status-w-peers | ||||
Merge into: | lp://staging/pyjuju | ||||
Diff against target: |
147 lines (+61/-10) 2 files modified
ensemble/control/status.py (+10/-5) ensemble/control/tests/test_status.py (+51/-5) |
||||
To merge this branch: | bzr merge lp://staging/~hazmat/pyjuju/status-w-peers | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gustavo Niemeyer | Approve | ||
Review via email: mp+66618@code.staging.launchpad.net |
Description of the change
Fixes ensemble status to work with peer relations.
To post a comment you must log in.
[1]
for relation in relations:
rel_ services = yield relation. get_service_ states( )
rel_services = [
rsn for rsn in rel_services if rsn.service_name !=
service. service_ name]
raise ValueError( "Unexpected relationship with more "
"than 2 endpoints")
# filter out 'self' if its nots a peer relation
if len(rel_services) > 1:
if len(rel_services) > 1:
This does fix it, I'd like to expand the comment such that its a bit more obvious whats happening there. To be clear this is my fault not yours, but a series of len(x) > 1 checks don't really related to how that handles peer relations or not. Something like:
# Singular rel_services imply a peer relation. Two rel_services imply a provides/requires relationship. In the later case we omit the local size of the relation in reporting.