From: Loic Dachary Date: Sun, 19 Jul 2015 07:04:54 +0000 (+0200) Subject: nuke: gracefully handle zero targets X-Git-Tag: 1.1.0~868^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F576%2Fhead;p=teuthology.git nuke: gracefully handle zero targets 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 --- diff --git a/teuthology/nuke.py b/teuthology/nuke.py index 2b386689..3cdcb6db 100644 --- a/teuthology/nuke.py +++ b/teuthology/nuke.py @@ -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: