fixed retry logic in Orchestrate

Change-Id: I63a043d3d63b8854511dbaed88da4178b02ce955
diff --git a/src/com/mirantis/mk/Salt.groovy b/src/com/mirantis/mk/Salt.groovy
index c5f03d6..a613799 100644
--- a/src/com/mirantis/mk/Salt.groovy
+++ b/src/com/mirantis/mk/Salt.groovy
@@ -160,14 +160,16 @@
     }
 
     if (optional == false || testTarget(saltId, target)){
-        if (retries != -1){
+        if (retries > 0){
+            failOnError = true
             retry(retries){
                 out = runSaltCommand(saltId, 'local', ['expression': target, 'type': 'compound'], 'state.sls', batch, [run_states], kwargs, -1, read_timeout)
+                checkResult(out, failOnError, output)
             }
         } else {
             out = runSaltCommand(saltId, 'local', ['expression': target, 'type': 'compound'], 'state.sls', batch, [run_states], kwargs, -1, read_timeout)
+            checkResult(out, failOnError, output)
         }
-        checkResult(out, failOnError, output)
         return out
     } else {
         common.infoMsg("No Minions matched the target given, but 'optional' param was set to true - Pipeline continues. ")