From d9f3c9f690d20a7b07fd3283e6c8de08b8c82532 Mon Sep 17 00:00:00 2001 From: Sandon Van Ness Date: Mon, 18 Aug 2014 11:51:26 -0700 Subject: [PATCH] Skip nuke and just destroy VPS if nuke is --unlock If the machine is being unlocked after than we definitely want to just destroy it. This way nukes will always suceed with --unlock even if the guest is down or in a borked state. Signed-off-by: Sandon Van Ness --- teuthology/nuke.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/teuthology/nuke.py b/teuthology/nuke.py index 58d87b4e7..6f4513484 100644 --- a/teuthology/nuke.py +++ b/teuthology/nuke.py @@ -373,7 +373,7 @@ def nuke_one(ctx, targets, should_unlock, synch_clocks, reboot_all, noipmi=noipmi, ) try: - nuke_helper(ctx) + nuke_helper(ctx, should_unlock) except Exception: log.exception('Could not nuke all targets in %s' % targets) # not re-raising the so that parallel calls aren't killed @@ -385,11 +385,13 @@ def nuke_one(ctx, targets, should_unlock, synch_clocks, reboot_all, return ret -def nuke_helper(ctx): +def nuke_helper(ctx, should_unlock): # ensure node is up with ipmi (target,) = ctx.config['targets'].keys() host = target.split('@')[-1] shortname = host.split('.')[0] + if should_unlock and 'vpm' in shortname: + return log.debug('shortname: %s' % shortname) log.debug('{ctx}'.format(ctx=ctx)) if not ctx.noipmi and 'ipmi_user' in ctx.teuthology_config and 'vpm' not in shortname: -- 2.47.3