Add check for redis-server version
PROD-36960
Change-Id: I14be3156b1c44041e60331e6e30685fa483101c7
diff --git a/src/com/mirantis/mcp/UpgradeChecks.groovy b/src/com/mirantis/mcp/UpgradeChecks.groovy
index 009dccd..c260baf 100644
--- a/src/com/mirantis/mcp/UpgradeChecks.groovy
+++ b/src/com/mirantis/mcp/UpgradeChecks.groovy
@@ -174,3 +174,29 @@
}
return waStatus
}
+
+def check_36960 (salt, venvPepper, String cluster_name, Boolean raise_exc) {
+ if (!salt.testTarget(venvPepper, 'I@redis:server')) {
+ return
+ }
+ def redisVersionPillar = salt.getPillar(venvPepper, 'I@redis:server', 'redis:server:version').get("return")[0].values()[0]
+
+ List redisVersion = redisVersionPillar.toString().tokenize('.')
+
+ def majorVersion = redisVersion[0].toInteger()
+ def minorVersion = redisVersion[1].toInteger()
+
+ def waStatus = [prodId: "PROD-36960", isFixed: "", waInfo: ""]
+
+ if (majorVersion >= 5 && minorVersion >= 0) {
+ waStatus.isFixed = 'Nothing to do. Redis-server version pillar is set to required version (5.0+).'
+ return waStatus
+ }
+ waStatus.isFixed = "Fix should be applied manually"
+ waStatus.waInfo = """To apply latest MU to openstack control plane you MUST set correct version for redis-server package. \n
+Please set pillar "redis:server:version" to "5.0" to openstack/telemetry.yml and refresh pillars."""
+ if (raise_exc) {
+ error('Option is not set to required value.\n' + waStatus.waInfo)
+ }
+ return waStatus
+}