Merge "Salt result checking improved"
diff --git a/src/com/mirantis/mcp/Validate.groovy b/src/com/mirantis/mcp/Validate.groovy
index f59ba01..670b101 100644
--- a/src/com/mirantis/mcp/Validate.groovy
+++ b/src/com/mirantis/mcp/Validate.groovy
@@ -155,7 +155,7 @@
         }
     }
     def script = ". ${env.WORKSPACE}/venv/bin/activate; ${settings}" +
-                 "pytest --junitxml ${output_dir}cvp_sanity.xml -sv ${env.WORKSPACE}/cvp-sanity-checks/cvp_checks/tests/${test_set}"
+                 "pytest --junitxml ${output_dir}cvp_sanity.xml --tb=short -sv ${env.WORKSPACE}/cvp-sanity-checks/cvp_checks/tests/${test_set}"
     withEnv(["SALT_USERNAME=${username}", "SALT_PASSWORD=${password}", "SALT_URL=${salt_url}"]) {
         def statusCode = sh script:script, returnStatus:true
     }
@@ -579,7 +579,7 @@
  *
  * @param target          Host with cvp container
  */
-def openstack_cleanup(master, target, script_path="/home/rally/cvp-configuration/clean.sh") {
+def openstack_cleanup(master, target, script_path="/home/rally/cvp-configuration/cleanup.sh") {
     def salt = new com.mirantis.mk.Salt()
     salt.runSaltProcessStep(master, "${target}", 'cmd.run', ["docker exec cvp bash -c ${script_path}"])
 }
diff --git a/src/com/mirantis/mk/Salt.groovy b/src/com/mirantis/mk/Salt.groovy
index eb4d828..b71bf2f 100644
--- a/src/com/mirantis/mk/Salt.groovy
+++ b/src/com/mirantis/mk/Salt.groovy
@@ -183,11 +183,13 @@
 
     if (optional == false || testTarget(saltId, target)){
         if (retries > 0){
+            def retriesCounter = 0
             retry(retries){
+                retriesCounter++
                 // we have to reverse order in saltArgs because salt state have to be first
                 out = runSaltCommand(saltId, 'local', ['expression': target, 'type': 'compound'], 'state.sls', batch, saltArgs.reverse(), kwargs, -1, read_timeout)
                 // failOnError should be passed as true because we need to throw exception for retry block handler
-                checkResult(out, true, output, true, true) //disable ask on error because we are using retry here
+                checkResult(out, true, output, true, retriesCounter < retries) //disable ask on error for every interation except last one
             }
         } else {
             // we have to reverse order in saltArgs because salt state have to be first