Add elasticsearch scheme var to status check

Change-Id: I5f28756f466313f063031931cbcd7de1c2a63324
PROD-related: PROD-30514
diff --git a/stacklight-upgrade.groovy b/stacklight-upgrade.groovy
index 85b93e9..a2d09e1 100644
--- a/stacklight-upgrade.groovy
+++ b/stacklight-upgrade.groovy
@@ -67,9 +67,18 @@
             errorOccured = true
             common.errorMsg('[ERROR] Elasticsearch VIP port could not be retrieved')
         }
+        pillar = salt.getPillar(master, "I@elasticsearch:client ${extra_tgt}", 'elasticsearch:client:server:scheme')
+        def elasticsearch_scheme
+        if(!pillar['return'].isEmpty()) {
+            elasticsearch_scheme = pillar['return'][0].values()[0]
+        } else {
+            common.infoMsg('No pillar with Elasticsearch server scheme, using http')
+            elasticsearch_scheme = "http"
+        }
+
         common.retry(retries,retries_wait) {
             common.infoMsg('Waiting for Elasticsearch to become green..')
-            salt.cmdRun(master, "I@elasticsearch:client", "curl -sf ${elasticsearch_vip}:${elasticsearch_port}/_cat/health | awk '{print \$4}' | grep green")
+            salt.cmdRun(master, "I@elasticsearch:client", "curl -sfk ${elasticsearch_scheme}://${elasticsearch_vip}:${elasticsearch_port}/_cat/health | awk '{print \$4}' | grep green")
         }
     } catch (Exception er) {
         errorOccured = true