]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
nuke: gracefully handle zero targets 576/head
authorLoic Dachary <ldachary@redhat.com>
Sun, 19 Jul 2015 07:04:54 +0000 (09:04 +0200)
committerLoic Dachary <ldachary@redhat.com>
Sun, 19 Jul 2015 07:09:32 +0000 (09:09 +0200)
If nuke is called with no targets, just do nothing instead of failing
because the target element is not found in the map. This can happen if
the machine fails to be provisioned early in the process.

Signed-off-by: Loic Dachary <loic@dachary.org>
teuthology/nuke.py

index 2b38668923b57134adcb5cd30dc25eee5f265d83..3cdcb6dbbf0df61858ab472dfd2202ac189ef949 100644 (file)
@@ -419,6 +419,8 @@ def main(args):
 
 
 def nuke(ctx, should_unlock, sync_clocks=True, reboot_all=True, noipmi=False):
+    if 'targets' not in ctx.config:
+        return
     total_unnuked = {}
     targets = dict(ctx.config['targets'])
     if ctx.name: