Merge "[CVP] Fix problem with TARGET_NODE and try-catch block" into release/proposed/2019.2.0
diff --git a/stacklight-upgrade.groovy b/stacklight-upgrade.groovy
index 7c932d0..75e2e40 100644
--- a/stacklight-upgrade.groovy
+++ b/stacklight-upgrade.groovy
@@ -70,7 +70,7 @@
             common.errorMsg('[ERROR] Elasticsearch VIP port could not be retrieved')
         }
 
-        pillar = salt.getReturnValues(salt.getPillar(master, "I@elasticsearch:client ${extra_tgt}", 'elasticsearch:client:server:scheme'))
+        pillar = salt.getReturnValues(salt.getPillar(master, "I@elasticsearch:client", 'elasticsearch:client:server:scheme'))
         def elasticsearch_scheme
         if(pillar) {
             elasticsearch_scheme = pillar
diff --git a/update-ceph.groovy b/update-ceph.groovy
index cde1401..72ac2d5 100644
--- a/update-ceph.groovy
+++ b/update-ceph.groovy
@@ -24,11 +24,11 @@
     return salt.cmdRun(master, target, cmd)
 }
 
-def waitForHealthy(master, tgt, attempts=100, timeout=10) {
+def waitForHealthy(master, tgt, count=0, attempts=100) {
     // wait for healthy cluster
     common = new com.mirantis.mk.Common()
     while (count<attempts) {
-        def health = runCephCommand(master, ADMIN_HOST, 'ceph health')['return'][0].values()[0]
+        def health = runCephCommand(master, tgt, 'ceph health')['return'][0].values()[0]
         if (health.contains('HEALTH_OK') || health.contains('HEALTH_WARN noout flag(s) set\n')) {
             common.infoMsg('Cluster is healthy')
             break;