Merge "Fix mos test triggers"
diff --git a/src/com/mirantis/mk/KaasUtils.groovy b/src/com/mirantis/mk/KaasUtils.groovy
index 262e584..15dbde2 100644
--- a/src/com/mirantis/mk/KaasUtils.groovy
+++ b/src/com/mirantis/mk/KaasUtils.groovy
@@ -130,6 +130,12 @@
         proxyConfig['mgmtOffline'] = true
         common.warningMsg('Forced running offline mgmt deployment, some provider CDN regions for mgmt deployment may be set to *public-ci* to verify proxy configuration')
     }
+    if (commitMsg ==~ /(?s).*\[mgmt-upgrade\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*mgmt-upgrade.*/) {
+        upgradeMgmt = true
+    }
+    if (commitMsg ==~ /(?s).*\[auto-upgrade\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*auto-upgrade.*/) {
+        autoUpgradeMgmt = true
+    }
     if (commitMsg ==~ /(?s).*\[seed-macos\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*seed-macos.*/) {
         seedMacOs = true
     }
@@ -148,6 +154,10 @@
         //TODO: revert after start testing the two-step upgrade again (PRODX-33510)
         //fullUpgradeChild = true
     }
+    if ((upgradeMgmt || autoUpgradeMgmt) && deployChild) {
+        upgradeChild = true
+        common.warningMsg('child upgrade is automatically enabled as mgmt upgrade and child deploy are enabled')
+    }
     def childDeployMatches = (commitMsg =~ /(\[child-deploy\s*(\w|\-)+?\])/)
     if (childDeployMatches.size() > 0) {
         // override child version when it set explicitly
@@ -162,6 +172,10 @@
         mosDeployChild = true
         mosUpgradeChild = true
     }
+    if ((upgradeMgmt || autoUpgradeMgmt) && mosDeployChild) {
+        mosUpgradeChild = true
+        common.warningMsg('MOSK child upgrade is automatically enabled as mgmt upgrade and MOSK child deploy are enabled')
+    }
     if (commitMsg ==~ /(?s).*\[byo-attach\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*byo-attach.*/) {
         attachBYO = true
     }
@@ -193,12 +207,6 @@
         attachBYO = false
         upgradeBYO = false
     }
-    if (commitMsg ==~ /(?s).*\[mgmt-upgrade\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*mgmt-upgrade.*/) {
-        upgradeMgmt = true
-    }
-    if (commitMsg ==~ /(?s).*\[auto-upgrade\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*auto-upgrade.*/) {
-        autoUpgradeMgmt = true
-    }
     if (commitMsg ==~ /(?s).*\[lma-logging\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*lma-logging.*/) {
         enableLMALogging = true
     }
diff --git a/src/com/mirantis/mk/Workflow.groovy b/src/com/mirantis/mk/Workflow.groovy
index 29e7b83..e4d75bf 100644
--- a/src/com/mirantis/mk/Workflow.groovy
+++ b/src/com/mirantis/mk/Workflow.groovy
@@ -28,7 +28,7 @@
 def printVariables(global_variables) {
     def message = "// Collected global_variables during the workflow:\n"
     for (variable in global_variables) {
-        message += "env.${variable.key}=\"${variable.value}\"\n"
+        message += "env.${variable.key}=\"\"\"${variable.value}\"\"\"\n"
     }
     common.warningMsg(message)
 }