diff --git a/src/com/mirantis/mcp/UpgradeChecks.groovy b/src/com/mirantis/mcp/UpgradeChecks.groovy index 8b4279b7..601ba8c6 100644 --- a/src/com/mirantis/mcp/UpgradeChecks.groovy +++ b/src/com/mirantis/mcp/UpgradeChecks.groovy @@ -92,10 +92,6 @@ def check_36461(salt, venvPepper, String cluster_name, Boolean raise_exc){ catch (Exception e) { waStatus.isFixed = "Check skipped" waStatus.waInfo = "Unable to check ordering of RadosGW imports, file ${checkFile} not found, skipping" - if (raise_exc) { - common.warningMsg(waStatus.waInfo) - return - } return waStatus } def fileContent = salt.cmdRun(venvPepper, saltTarget, "cat ${checkFile}").get('return')[0].values()[0].replaceAll('Salt command execution success', '').trim() @@ -140,6 +136,11 @@ For additional information please see https://docs.mirantis.com/mcp/q4-18/mcp-re def check_36461_2 (salt, venvPepper, String cluster_name, Boolean raise_exc) { def saltTarget = salt.getFirstMinion(venvPepper, 'I@ceph:mon') + def waStatus = [prodId: "PROD-36461,PROD-36942", isFixed: "", waInfo: ""] + if (!saltTarget){ + waStatus.isFixed = "Ceph not enabled, skipping" + return waStatus + } def cephVersionNum = salt.cmdRun(venvPepper, saltTarget, "ceph version | awk '{print \$3}'").get('return')[0].values()[0].replaceAll('Salt command execution success', '').trim() List cephVersion = cephVersionNum.tokenize('.') @@ -147,8 +148,6 @@ def check_36461_2 (salt, venvPepper, String cluster_name, Boolean raise_exc) { def minorVersion = cephVersion[1].toInteger() def minorSubversion = cephVersion[2].toInteger() - def waStatus = [prodId: "PROD-36461,PROD-36942", isFixed: "", waInfo: ""] - def allowInsecureReclaimIdPillar = salt.getPillar(venvPepper, 'I@ceph:mon', 'ceph:common:config:mon:auth_allow_insecure_global_id_reclaim').get("return")[0].values()[0] allowInsecureReclaimIdPillar = allowInsecureReclaimIdPillar.toString().toLowerCase().trim() @@ -203,3 +202,32 @@ Please set pillar "redis:server:version" to "5.0" to openstack/telemetry.yml and } return waStatus } + +def check_37068 (salt, venvPepper, String cluster_name, Boolean raise_exc) { + def waStatus = [prodId: "PROD-37068", isFixed: "", waInfo: ""] + def dogtag_enabled = salt.getPillar(venvPepper, 'I@dogtag:server', "dogtag:server:enabled").get("return")[0].values()[0] + def pushgateway_enabled = salt.getPillar(venvPepper, 'I@docker:client:stack:monitoring', "prometheus:pushgateway:enabled").get("return")[0].values()[0] + if (dogtag_enabled == '' || dogtag_enabled == 'false' || dogtag_enabled == null) { + waStatus.isFixed = 'Nothing to do. Dogtag is disabled.' + return waStatus + } else { + if (pushgateway_enabled == '' || pushgateway_enabled == 'false' || pushgateway_enabled == null) { + waStatus.isFixed = 'Nothing to do. Pushgateway is disabled.' + return waStatus + } else { + def stacklightMonitorHostnamePillar = salt.getPillar(venvPepper, 'I@dogtag:server', 'dogtag:server:stacklight_monitor_hostname').get("return")[0].values()[0] + if (stacklightMonitorHostnamePillar == '' || stacklightMonitorHostnamePillar == 'null' || stacklightMonitorHostnamePillar == null) { + waStatus.isFixed = "Work-around should be applied manually" + waStatus.waInfo = """To enable dogtag certificates expriration alerts you MUST set stacklight monitor endpoint. \n +Please set pillar "dogtag:server:stacklight_monitor_hostname" to the value of _param:stacklight_monitor_hostname in openstack/barbican.yml and refresh pillars.""" + if (raise_exc) { + error('Pillar dogtag:server:stacklight_monitor_hostname is not defined.\n' + + waStatus.waInfo) + } + return waStatus + } + waStatus.isFixed = "Work-around for PROD-37068 already applied, nothing todo" + return waStatus + } + } +} diff --git a/src/com/mirantis/mk/Gerrit.groovy b/src/com/mirantis/mk/Gerrit.groovy index 7c19875a..82f9b59f 100644 --- a/src/com/mirantis/mk/Gerrit.groovy +++ b/src/com/mirantis/mk/Gerrit.groovy @@ -187,7 +187,7 @@ def getGerritChange(gerritName, gerritHost, gerritChangeNumber, credentialsId, i if(includeCurrentPatchset){ curPatchset = "--current-patch-set" } - return common.parseJSON(ssh.agentSh(String.format("ssh -p 29418 %s@%s gerrit query ${curPatchset} --format=JSON change:%s", gerritName, gerritHost, gerritChangeNumber))) + return common.parseJSON(ssh.agentSh(String.format("ssh -p 29418 %s@%s gerrit query ${curPatchset} --commit-message --format=JSON change:%s", gerritName, gerritHost, gerritChangeNumber))) } /**