~xianghui/charms/trusty/hacluster/support-ipv6

« back to all changes in this revision

Viewing changes to hooks/hooks.py

  • Committer: James Page
  • Date: 2014-03-31 14:47:24 UTC
  • mfrom: (18.1.2 pcmk-wait)
  • Revision ID: james.page@canonical.com-20140331144724-0q6gwkg9kzzhngzv
[ivoks] Wait for configuration to be applied before declaring success

Show diffs side-by-side

added added

removed removed

Lines of Context:
240
240
            #if not pcmk.is_resource_present(res_name):
241
241
            if not pcmk.crm_opt_exists(res_name):
242
242
                if not res_name in resource_params:
243
 
                    cmd = 'crm -F configure primitive %s %s' % (res_name,
244
 
                                                                res_type)
 
243
                    cmd = 'crm -w -F configure primitive %s %s' % (res_name,
 
244
                                                                   res_type)
245
245
                else:
246
 
                    cmd = 'crm -F configure primitive %s %s %s' % \
 
246
                    cmd = 'crm -w -F configure primitive %s %s %s' % \
247
247
                                (res_name,
248
248
                                 res_type,
249
249
                                 resource_params[res_name])
254
254
        utils.juju_log('INFO', str(groups))
255
255
        for grp_name, grp_params in groups.iteritems():
256
256
            if not pcmk.crm_opt_exists(grp_name):
257
 
                cmd = 'crm -F configure group %s %s' % (grp_name, grp_params)
 
257
                cmd = 'crm -w -F configure group %s %s' % (grp_name,
 
258
                                                           grp_params)
258
259
                pcmk.commit(cmd)
259
260
                utils.juju_log('INFO', '%s' % cmd)
260
261
 
262
263
        utils.juju_log('INFO', str(ms))
263
264
        for ms_name, ms_params in ms.iteritems():
264
265
            if not pcmk.crm_opt_exists(ms_name):
265
 
                cmd = 'crm -F configure ms %s %s' % (ms_name, ms_params)
 
266
                cmd = 'crm -w -F configure ms %s %s' % (ms_name, ms_params)
266
267
                pcmk.commit(cmd)
267
268
                utils.juju_log('INFO', '%s' % cmd)
268
269
 
270
271
        utils.juju_log('INFO', str(orders))
271
272
        for ord_name, ord_params in orders.iteritems():
272
273
            if not pcmk.crm_opt_exists(ord_name):
273
 
                cmd = 'crm -F configure order %s %s' % (ord_name, ord_params)
 
274
                cmd = 'crm -w -F configure order %s %s' % (ord_name,
 
275
                                                           ord_params)
274
276
                pcmk.commit(cmd)
275
277
                utils.juju_log('INFO', '%s' % cmd)
276
278
 
278
280
        utils.juju_log('INFO', str(colocations))
279
281
        for col_name, col_params in colocations.iteritems():
280
282
            if not pcmk.crm_opt_exists(col_name):
281
 
                cmd = 'crm -F configure colocation %s %s' % (col_name, col_params)
 
283
                cmd = 'crm -w -F configure colocation %s %s' % (col_name,
 
284
                                                                col_params)
282
285
                pcmk.commit(cmd)
283
286
                utils.juju_log('INFO', '%s' % cmd)
284
287
 
286
289
        utils.juju_log('INFO', str(clones))
287
290
        for cln_name, cln_params in clones.iteritems():
288
291
            if not pcmk.crm_opt_exists(cln_name):
289
 
                cmd = 'crm -F configure clone %s %s' % (cln_name, cln_params)
 
292
                cmd = 'crm -w -F configure clone %s %s' % (cln_name,
 
293
                                                           cln_params)
290
294
                pcmk.commit(cmd)
291
295
                utils.juju_log('INFO', '%s' % cmd)
292
296