Merge "Use tox to run 'app.py update' to update artifact-metadata"
diff --git a/src/com/mirantis/mk/Workflow.groovy b/src/com/mirantis/mk/Workflow.groovy
index a3502bd..c127625 100644
--- a/src/com/mirantis/mk/Workflow.groovy
+++ b/src/com/mirantis/mk/Workflow.groovy
@@ -233,8 +233,20 @@
         runSteps(scenario['finally'], global_variables, failed_jobs)
 
         if (failed_jobs) {
+            statuses = []
+            failed_jobs.each {
+                statuses += it.split(":").last()
+                }
+            if (statuses.contains('FAILURE')) {
+                currentBuild.result = 'FAILURE'
+            }
+            else if (statuses.contains('UNSTABLE')) {
+                currentBuild.result = 'UNSTABLE'
+            }
+            else {
+                currentBuild.result = 'FAILURE'
+            }
             println "Failed jobs: ${failed_jobs}"
-            currentBuild.result = "FAILED"
         }
-    } // try
+    } // finally
 }