From 2a47843139598e8d2fd9a3bd8fcf0f4c4639581e Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Sun, 19 Jul 2015 09:04:54 +0200 Subject: [PATCH] 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 --- teuthology/nuke.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/teuthology/nuke.py b/teuthology/nuke.py index 2b38668923..3cdcb6dbbf 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: -- 2.39.5