doc = """
usage:
teuthology-nuke --help
- teuthology-nuke [-v] [--owner OWNER] [-n NAME] [-u] [-i] [-r] [-s] [-k]
+ teuthology-nuke [-v] [--owner OWNER] [-n NAME] [-u] [-i] [-r|-R] [-s] [-k]
[-p PID] [--dry-run] (-t CONFIG... | -a DIR)
teuthology-nuke [-v] [-u] [-i] [-r] [-s] [--dry-run] --owner OWNER --stale
teuthology-nuke [-v] [--dry-run] --stale-openstack
targets that would be nuked
--owner OWNER job owner
-p PID, --pid PID pid of the process to be killed
- -r, --reboot-all reboot all machines
+ -r, --reboot-all reboot all machines (default)
+ -R, --no-reboot do not reboot the machines
-s, --synch-clocks synchronize clocks on all machines
-u, --unlock Unlock each successfully nuked machine, and output
targets thatcould not be nuked.
else:
subprocess.check_call(["kill", "-9", str(ctx.pid)])
- nuke(ctx, ctx.unlock, ctx.synch_clocks, ctx.reboot_all, ctx.noipmi)
+ nuke(ctx, ctx.unlock, ctx.synch_clocks, ctx.noipmi)
-def nuke(ctx, should_unlock, sync_clocks=True, reboot_all=True, noipmi=False):
+def nuke(ctx, should_unlock, sync_clocks=True, noipmi=False):
if 'targets' not in ctx.config:
return
total_unnuked = {}
{target: hostkey},
should_unlock,
sync_clocks,
- reboot_all,
ctx.config.get('check-locks', True),
noipmi,
)
default_flow_style=False).splitlines()))
-def nuke_one(ctx, target, should_unlock, synch_clocks, reboot_all,
+def nuke_one(ctx, target, should_unlock, synch_clocks,
check_locks, noipmi):
ret = None
keep_logs = ctx.keep_logs
+ should_reboot = not ctx.no_reboot
ctx = argparse.Namespace(
config=dict(targets=target),
owner=ctx.owner,
check_locks=check_locks,
synch_clocks=synch_clocks,
- reboot_all=reboot_all,
teuthology_config=config.to_dict(),
name=ctx.name,
noipmi=noipmi,
)
try:
- nuke_helper(ctx, should_unlock, keep_logs)
+ nuke_helper(ctx, should_unlock, keep_logs, should_reboot)
except Exception:
log.exception('Could not nuke %s' % target)
# not re-raising the so that parallel calls aren't killed
return ret
-def nuke_helper(ctx, should_unlock, keep_logs):
+def nuke_helper(ctx, should_unlock, keep_logs, should_reboot):
# ensure node is up with ipmi
(target,) = ctx.config['targets'].keys()
host = target.split('@')[-1]
# Try to remove packages before reboot
remove_installed_packages(ctx)
remotes = ctx.cluster.remotes.keys()
- reboot(ctx, remotes)
+ if should_reboot:
+ reboot(ctx, remotes)
# shutdown daemons again incase of startup
shutdown_daemons(ctx)
remove_osd_mounts(ctx)