Add PROD-37068 upgrade check

Related-Prod: PROD-37068
Change-Id: I7df7b9e5c34308fb20e6d8cc7a0741fc2410600d
diff --git a/src/com/mirantis/mcp/UpgradeChecks.groovy b/src/com/mirantis/mcp/UpgradeChecks.groovy
index 68229a0..601ba8c 100644
--- a/src/com/mirantis/mcp/UpgradeChecks.groovy
+++ b/src/com/mirantis/mcp/UpgradeChecks.groovy
@@ -202,3 +202,32 @@
     }
     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
+        }
+    }
+}