15133: Remove 'commits' table, move functions to CommitsHelper
[arvados.git] / doc / sdk / python / cookbook.html.textile.liquid
index 1c0f4500d3f97585fc8bee0afdc162b81f731817..0bc697077cf892aaad54c78c7c966316aa1c3f24 100644 (file)
@@ -81,18 +81,13 @@ def get_cr_state(cr_uuid):
             return 'On hold'
         else:
             return 'Queued'
-    elif c['state'] == 'Complete':
-        if c['exit_code'] == 0:
-            return c['state']
-        else:
-            return 'Failed'
+    elif c['state'] == 'Complete' and c['exit_code'] != 0
+        return 'Failed'
     elif c['state'] == 'Running':
         if c['runtime_status'].get('error', None):
             return 'Failing'
         elif c['runtime_status'].get('warning', None):
             return 'Warning'
-        else:
-            return c['state']
     return c['state']
 container_request_uuid = 'qr1hi-xvhdp-zzzzzzzzzzzzzzz'
 print(get_cr_state(container_request_uuid))