]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
lock_machines(): Use dead status for lock failures 777/head
authorZack Cerza <zack@redhat.com>
Tue, 26 Jan 2016 17:37:20 +0000 (10:37 -0700)
committerZack Cerza <zack@redhat.com>
Wed, 27 Jan 2016 21:23:27 +0000 (14:23 -0700)
Signed-off-by: Zack Cerza <zack@redhat.com>
teuthology/task/internal.py

index 8be59843e9c3340a5d5ff64454c6bc7f97ac1444..1d80ba5da8ab08de87246ab853c5d4dbbb08009f 100644 (file)
@@ -110,8 +110,14 @@ def lock_machines(ctx, config):
                 assert 0, ('not enough machines free; need %s + %s, have %s' %
                            (reserved, requested, len(machines)))
 
-        newly_locked = lock.lock_many(ctx, requested, machine_type, ctx.owner,
-                                      ctx.archive, os_type, os_version, arch)
+        try:
+            newly_locked = lock.lock_many(ctx, requested, machine_type,
+                                          ctx.owner, ctx.archive, os_type,
+                                          os_version, arch)
+        except Exception:
+            # Lock failures should map to the 'dead' status instead of 'fail'
+            set_status(ctx.summary, 'dead')
+            raise
         all_locked.update(newly_locked)
         log.info(
             '{newly_locked} {mtype} machines locked this try, '