Merge lp:~kubernetes/charms/trusty/etcd/trunk into lp:charms/trusty/etcd

Proposed by Charles Butler
Status: Merged
Approved by: Matt Bruzek
Approved revision: 17
Merge reported by: Matt Bruzek
Merged at revision: not available
Proposed branch: lp:~kubernetes/charms/trusty/etcd/trunk
Merge into: lp:charms/trusty/etcd
Diff against target: 46 lines (+15/-2)
2 files modified
README.md (+7/-1)
hooks/hooks.py (+8/-1)
To merge this branch: bzr merge lp:~kubernetes/charms/trusty/etcd/trunk
Reviewer Review Type Date Requested Status
Matt Bruzek (community) Approve
Review via email: mp+267696@code.launchpad.net

Description of the change

is_leader requires juju 1.23.2 or better

The ETCD charm fails with a non committal error message when probing for
is_leader, and will cause some headaches if users of older Juju
versions attempt to use this charm as its leveraging the leader election
components.

To post a comment you must log in.
Revision history for this message
Matt Bruzek (mbruzek) wrote :

-1 You have merge conflict stuff in there.

review: Needs Fixing
17. By Charles Butler

Backport of store edits and minor typo correction
Marco Ceppi 2015-08-07 [merge] [lazypower] Working fix for #1478121
Matthew Bruzek 2015-07-17 Changing the deploy syntax to use the promulgated namespace.

Revision history for this message
Matt Bruzek (mbruzek) wrote :

+1 this looks right, sorry for my part in the confusion on the merge.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'README.md'
2--- README.md 2015-07-17 14:48:11 +0000
3+++ README.md 2015-08-11 17:56:53 +0000
4@@ -51,11 +51,17 @@
5 juju action fetch <uuid>
6
7
8+## Usage Caveats
9+
10+This charm requires Leader Election, which is a feature of Juju >= 1.23.2. The
11+charm will panic and refuse to continue if the leader_election binary is not
12+found. Please take care when deploying this charm on older versions of Juju.
13+
14 ## Credits
15
16 The etcd charm was originally written by Kapil Thangavelu ([@kapilt](https://github.com/kapilt)).
17
18-#### Mantainers:
19+#### Maintainers:
20
21 The kubernetes team maintains this charm:
22 - Whit Morriss &lt;whit.morriss@canonical.com&gt;
23
24=== modified file 'hooks/hooks.py'
25--- hooks/hooks.py 2015-07-24 19:30:09 +0000
26+++ hooks/hooks.py 2015-08-11 17:56:53 +0000
27@@ -16,11 +16,18 @@
28 hook_data = unitdata.HookData()
29 db = unitdata.kv()
30
31-leader_status = check_output(['is-leader']).rstrip() != "False"
32 private_address = hookenv.unit_get('private-address')
33 public_address = hookenv.unit_get('private-address')
34 unit_name = environ['JUJU_UNIT_NAME'].replace('/', '')
35
36+try:
37+ leader_status = hookenv.is_leader()
38+except NotImplementedError:
39+ hookenv.log('This charm requires Leader Election. Juju >= 1.23.2.'
40+ ' Leader election binary not found, Panic and exit!',
41+ 'CRITICAL')
42+ sys.exit(1)
43+
44
45 @hooks.hook('config-changed')
46 def config_changed():

Subscribers

People subscribed via source and target branches

to all changes: