From 452aabfe4b6e8052704df3dddee236ec23a02fbd Mon Sep 17 00:00:00 2001 From: Dmitry Burmistrov Date: Fri, 28 Oct 2022 15:49:33 +0400 Subject: [PATCH 1/3] [mk][gerrit] Include commit-message PROD-37068 Change-Id: I4f963d2313debd80f24299de3cdb077783e6493d --- src/com/mirantis/mk/Gerrit.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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))) } /** From 68b37b54aae0dcefda9e9973130bc72f4a9a4a50 Mon Sep 17 00:00:00 2001 From: Vladimir Khlyunev Date: Tue, 21 Feb 2023 06:24:54 +0400 Subject: [PATCH 2/3] Adjust ceph pre-upgrade-checks in case ceph is not deployed PROD-37108 Change-Id: Ic10e356b1c61ddc2020fe209f6a38e836fb8fede --- src/com/mirantis/mcp/UpgradeChecks.groovy | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/com/mirantis/mcp/UpgradeChecks.groovy b/src/com/mirantis/mcp/UpgradeChecks.groovy index 8b4279b7..68229a00 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() From 640b73ed8ab72ef173b31687246f813aecbbe323 Mon Sep 17 00:00:00 2001 From: Oleksii Molchanov Date: Wed, 11 Jan 2023 11:15:54 +0200 Subject: [PATCH 3/3] Add PROD-37068 upgrade check Related-Prod: PROD-37068 Change-Id: I7df7b9e5c34308fb20e6d8cc7a0741fc2410600d --- src/com/mirantis/mcp/UpgradeChecks.groovy | 29 +++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/com/mirantis/mcp/UpgradeChecks.groovy b/src/com/mirantis/mcp/UpgradeChecks.groovy index 68229a00..601ba8c6 100644 --- a/src/com/mirantis/mcp/UpgradeChecks.groovy +++ b/src/com/mirantis/mcp/UpgradeChecks.groovy @@ -202,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 + } + } +}