Merge ~mariosplivalo/charm-mongodb:lp1420852 into ~mongodb-charmers/charm-mongodb:master
Proposed by
Mario Splivalo
Status: | Merged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Approved by: | Jay Kuri | ||||||||
Approved revision: | 410a8381c4328453c7bfd17c9ed047a16c39489d | ||||||||
Merged at revision: | 96c4efc1d32fb34dcab2e6f18dd24a2fc3349214 | ||||||||
Proposed branch: | ~mariosplivalo/charm-mongodb:lp1420852 | ||||||||
Merge into: | ~mongodb-charmers/charm-mongodb:master | ||||||||
Diff against target: |
96 lines (+29/-21) 2 files modified
hooks/hooks.py (+12/-21) unit_tests/test_hooks.py (+17/-0) |
||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jay Kuri (community) | Approve | ||
Review via email: mp+330837@code.launchpad.net |
Commit message
Make replicaset-
Closes-Bug: LP #lp1436029
Description of the change
Make replicaset-
When units are being removed they are querying replicaset status
to locate the primary unit. Then, they use primary unit to remove
themselves from replicaset.
However, when the last unit is being removed (during complete
service removal) the 'primary' key in replicaseet status is no
longer there (as the unit switched to secondary, and there is no
primary).
This code change anticipates missing 'primary' key. If so, it will
cleanly exit the hook so that juju can remove the unit cleanly.
To post a comment you must log in.
Looks good to me.