Add check for target node before hightstate

The patch adds check for target node before run highstate to
be sure that all parts which are used in composed target string
otherwise salt API returns empty response and pipeline fails.

Change-Id: Idcf1f759a8be7e0618129c73db6c6f448dd9c687
diff --git a/src/com/mirantis/mk/Orchestrate.groovy b/src/com/mirantis/mk/Orchestrate.groovy
index 4518c8e..0d9cb5c 100644
--- a/src/com/mirantis/mk/Orchestrate.groovy
+++ b/src/com/mirantis/mk/Orchestrate.groovy
@@ -503,8 +503,11 @@
         def gluster_compound = 'I@glusterfs:server'
         def salt_ca_compound = 'I@salt:minion:ca:salt_master_ca'
         // Enforce highstate asynchronous only on compute nodes which are not glusterfs and not salt ca servers
-        retry(2) {
-            salt.enforceHighstateWithExclude(master, compute_compound + ' and not ' + gluster_compound + ' and not ' + salt_ca_compound, 'opencontrail.client')
+        def hightstateTarget = "${compute_compound} and not ${gluster_compound} and not ${salt_ca_compound}"
+        if (salt.testTarget(master, hightstateTarget)) {
+            retry(2) {
+                salt.enforceHighstateWithExclude(master, hightstateTarget, 'opencontrail.client')
+            }
         }
         // Iterate through salt ca servers and check if they have compute role
         // TODO: switch to batch once salt 2017.7+ would be used