From: Sandon Van Ness Date: Mon, 18 Aug 2014 18:51:26 +0000 (-0700) Subject: Skip nuke and just destroy VPS if nuke is --unlock X-Git-Tag: 1.1.0~1256^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F315%2Fhead;p=teuthology.git 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 --- 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: