Fix targetting for restartDesignate()
Because of a wrong targeting the designate-central service restarts
many times on several nodes during the upgrade procedure. It causes
different errors in connection between designate-api in cluster and
blocked whole upgrading.
This fix change targeting from roles to the nodes itself.
Related-PROD: PROD-37131
Change-Id: Ifd8045e151dfe693e76544f2e20748f6432724ba
diff --git a/openstack-control-upgrade.groovy b/openstack-control-upgrade.groovy
index a995641..f5bee78 100644
--- a/openstack-control-upgrade.groovy
+++ b/openstack-control-upgrade.groovy
@@ -131,16 +131,16 @@
}
}
-def checkDesignate(env) {
+def restartDesignate(env, target) {
def common = new com.mirantis.mk.Common()
def salt = new com.mirantis.mk.Salt()
// Workaround for PROD-33592, restart designate-central services if enabled
- designate_enabled = salt.getPillar(env, 'I@designate:server', "designate:server:enabled").get("return")[0].values()[0]
+ designate_enabled = salt.getPillar(env, target, "designate:server:enabled").get("return")[0].values()[0]
if (designate_enabled == '' || designate_enabled == 'false' || designate_enabled == null) {
common.infoMsg('Designate is disabled, nothing to do')
} else {
try {
- salt.runSaltProcessStep(env, "I@designate:server", "service.restart", "designate-central", null, true)
+ salt.runSaltProcessStep(env, target, "service.restart", "designate-central", null, true)
}
catch (Exception ex) {
common.infoMsg(ex)
@@ -177,7 +177,7 @@
openstack.runOpenStackUpgradePhase(env, target, 'pre')
salt.runSaltProcessStep(env, target, 'saltutil.refresh_pillar', [], null, true)
salt.enforceState(env, target, 'linux.system.repo')
- checkDesignate(env)
+ restartDesignate(env, target)
openstack.runOpenStackUpgradePhase(env, target, 'verify')
}
}
@@ -206,7 +206,6 @@
common.stageWrapper(upgradeStageMap, "Upgrade OpenStack", target, interactive) {
openstack.runOpenStackUpgradePhase(env, target, 'upgrade')
openstack.applyOpenstackAppsStates(env, target)
- checkDesignate(env)
openstack.runOpenStackUpgradePhase(env, target, 'verify')
}
}