~jacekn/charms/precise/ceph/n-e-m

« back to all changes in this revision

Viewing changes to hooks/hooks.py

  • Committer: Robert Ayres
  • Date: 2013-05-22 09:37:54 UTC
  • mfrom: (57.1.1 ceph)
  • Revision ID: robert.ayres@canonical.com-20130522093754-uap5b6t8bved924v
Merging James' changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
255
255
    utils.juju_log('INFO', 'Begin notify_client.')
256
256
 
257
257
    for relid in utils.relation_ids('client'):
258
 
        service_name = utils.relation_list(relid)[0].split('/')[0]
259
 
        utils.relation_set(key=ceph.get_named_key(service_name),
260
 
                           auth=utils.config_get('auth-supported'),
261
 
                           rid=relid)
 
258
        units = utils.relation_list(relid)
 
259
        if len(units) > 0:
 
260
            service_name = units[0].split('/')[0]
 
261
            utils.relation_set(key=ceph.get_named_key(service_name),
 
262
                               auth=utils.config_get('auth-supported'),
 
263
                               rid=relid)
262
264
 
263
265
    utils.juju_log('INFO', 'End notify_client.')
264
266