~gandelman-a/charms/precise/ceph/fail_early

« back to all changes in this revision

Viewing changes to hooks/hooks.py

  • Committer: James Page
  • Date: 2012-10-18 08:24:36 UTC
  • mfrom: (48.1.3 ceph)
  • Revision ID: james.page@canonical.com-20121018082436-g780tz6coav8hhvl
Merged changes from pjdc including cephx configuration support and better arbitarty repository handling

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
 
34
34
def emit_cephconf():
35
35
    cephcontext = {
 
36
        'auth_supported': utils.config_get('auth-supported'),
36
37
        'mon_hosts': ' '.join(get_mon_hosts()),
37
38
        'fsid': utils.config_get('fsid'),
38
39
        }
166
167
    for relid in utils.relation_ids('osd'):
167
168
        utils.relation_set(fsid=utils.config_get('fsid'),
168
169
                           osd_bootstrap_key=ceph.get_osd_bootstrap_key(),
 
170
                           auth=utils.config_get('auth-supported'),
169
171
                           rid=relid)
170
172
 
171
173
    utils.juju_log('INFO', 'End notify_osds.')
176
178
 
177
179
    for relid in utils.relation_ids('radosgw'):
178
180
        utils.relation_set(radosgw_key=ceph.get_radosgw_key(),
 
181
                           auth=utils.config_get('auth-supported'),
179
182
                           rid=relid)
180
183
 
181
184
    utils.juju_log('INFO', 'End notify_radosgws.')
187
190
    for relid in utils.relation_ids('client'):
188
191
        service_name = utils.relation_list(relid)[0].split('/')[0]
189
192
        utils.relation_set(key=ceph.get_named_key(service_name),
 
193
                           auth=utils.config_get('auth-supported'),
190
194
                           rid=relid)
191
195
 
192
196
    utils.juju_log('INFO', 'End notify_client.')
199
203
        utils.juju_log('INFO',
200
204
                       'mon cluster in quorum - providing fsid & keys')
201
205
        utils.relation_set(fsid=utils.config_get('fsid'),
202
 
                           osd_bootstrap_key=ceph.get_osd_bootstrap_key())
 
206
                           osd_bootstrap_key=ceph.get_osd_bootstrap_key(),
 
207
                           auth=utils.config_get('auth-supported'))
203
208
    else:
204
209
        utils.juju_log('INFO',
205
210
                       'mon cluster not in quorum - deferring fsid provision')
216
221
        utils.juju_log('INFO',
217
222
                       'mon cluster in quorum - \
218
223
                        providing radosgw with keys')
219
 
        utils.relation_set(radosgw_key=ceph.get_radosgw_key())
 
224
        utils.relation_set(radosgw_key=ceph.get_radosgw_key(),
 
225
                           auth=utils.config_get('auth-supported'))
220
226
    else:
221
227
        utils.juju_log('INFO',
222
228
                       'mon cluster not in quorum - deferring key provision')
232
238
                       'mon cluster in quorum - \
233
239
                        providing client with keys')
234
240
        service_name = os.environ['JUJU_REMOTE_UNIT'].split('/')[0]
235
 
        utils.relation_set(key=ceph.get_named_key(service_name))
 
241
        utils.relation_set(key=ceph.get_named_key(service_name),
 
242
                           auth=utils.config_get('auth-supported'))
236
243
    else:
237
244
        utils.juju_log('INFO',
238
245
                       'mon cluster not in quorum - deferring key provision')