Reorder colocation creation
A colocation constraint may reference a clone resource (which percona-cluster charm does). So, the colocation must be created after the clones. Closes-Bug: #1808166 Change-Id: I304df954b2f81477535fe64687af11055b932c27
This commit is contained in:
parent
81b386d379
commit
2ca245127e
@ -378,14 +378,6 @@ def ha_relation_changed():
|
||||
pcmk.commit(cmd)
|
||||
log('%s' % cmd, level=DEBUG)
|
||||
|
||||
log('Configuring Colocations: %s' % colocations, level=DEBUG)
|
||||
for col_name, col_params in colocations.iteritems():
|
||||
if not pcmk.crm_opt_exists(col_name):
|
||||
cmd = 'crm -w -F configure colocation %s %s' % (col_name,
|
||||
col_params)
|
||||
pcmk.commit(cmd)
|
||||
log('%s' % cmd, level=DEBUG)
|
||||
|
||||
log('Configuring Clones: %s' % clones, level=DEBUG)
|
||||
for cln_name, cln_params in clones.iteritems():
|
||||
if not pcmk.crm_opt_exists(cln_name):
|
||||
@ -394,6 +386,18 @@ def ha_relation_changed():
|
||||
pcmk.commit(cmd)
|
||||
log('%s' % cmd, level=DEBUG)
|
||||
|
||||
# Ordering is important here, colocation and location constraints
|
||||
# reference resources. All resources referenced by the constraints
|
||||
# need to exist otherwise constraint creation will fail.
|
||||
|
||||
log('Configuring Colocations: %s' % colocations, level=DEBUG)
|
||||
for col_name, col_params in colocations.iteritems():
|
||||
if not pcmk.crm_opt_exists(col_name):
|
||||
cmd = 'crm -w -F configure colocation %s %s' % (col_name,
|
||||
col_params)
|
||||
pcmk.commit(cmd)
|
||||
log('%s' % cmd, level=DEBUG)
|
||||
|
||||
log('Configuring Locations: %s' % locations, level=DEBUG)
|
||||
for loc_name, loc_params in locations.iteritems():
|
||||
if not pcmk.crm_opt_exists(loc_name):
|
||||
|
Loading…
x
Reference in New Issue
Block a user