Merge lp:~james-page/charms/precise/ceph/fix-notify-clients into lp:~charmers/charms/precise/ceph/trunk

Proposed by James Page
Status: Merged
Merged at revision: 58
Proposed branch: lp:~james-page/charms/precise/ceph/fix-notify-clients
Merge into: lp:~charmers/charms/precise/ceph/trunk
Diff against target: 19 lines (+6/-4)
1 file modified
hooks/hooks.py (+6/-4)
To merge this branch: bzr merge lp:~james-page/charms/precise/ceph/fix-notify-clients
Reviewer Review Type Date Requested Status
Robert Ayres (community) Approve
Review via email: mp+161835@code.launchpad.net

Description of the change

This fixes up a hook error I noticed when a client relation is in place but none of the clients have actually appears on the relation.

To post a comment you must log in.
Revision history for this message
Robert Ayres (robert-ayres) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/hooks.py'
2--- hooks/hooks.py 2013-03-12 16:30:06 +0000
3+++ hooks/hooks.py 2013-05-01 15:04:25 +0000
4@@ -255,10 +255,12 @@
5 utils.juju_log('INFO', 'Begin notify_client.')
6
7 for relid in utils.relation_ids('client'):
8- service_name = utils.relation_list(relid)[0].split('/')[0]
9- utils.relation_set(key=ceph.get_named_key(service_name),
10- auth=utils.config_get('auth-supported'),
11- rid=relid)
12+ units = utils.relation_list(relid)
13+ if len(units) > 0:
14+ service_name = units[0].split('/')[0]
15+ utils.relation_set(key=ceph.get_named_key(service_name),
16+ auth=utils.config_get('auth-supported'),
17+ rid=relid)
18
19 utils.juju_log('INFO', 'End notify_client.')
20

Subscribers

People subscribed via source and target branches

to all changes: