doc = """
usage:
teuthology-nuke --help
- teuthology-nuke [-v] [--owner OWNER] [-n NAME] [-u] [-i] [-r] [-s]
+ teuthology-nuke [-v] [--owner OWNER] [-n NAME] [-u] [-i] [-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 thatcould not be nuked.
-n NAME, --name NAME Name of run to cleanup
-i, --noipmi Skip ipmi checking
+ -k, --keep-logs Preserve test directories and logs on the machines
Examples:
teuthology-nuke -t target.yaml --unlock --owner user@host
def nuke_one(ctx, target, should_unlock, synch_clocks, reboot_all,
check_locks, noipmi):
ret = None
+ keep_logs = ctx.keep_logs
ctx = argparse.Namespace(
config=dict(targets=target),
owner=ctx.owner,
noipmi=noipmi,
)
try:
- nuke_helper(ctx, should_unlock)
+ nuke_helper(ctx, should_unlock, keep_logs)
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):
+def nuke_helper(ctx, should_unlock, keep_logs):
# ensure node is up with ipmi
(target,) = ctx.config['targets'].keys()
host = target.split('@')[-1]
undo_multipath(ctx)
reset_syslog_dir(ctx)
remove_ceph_data(ctx)
- remove_testing_tree(ctx)
+ if not keep_logs:
+ remove_testing_tree(ctx)
remove_yum_timedhosts(ctx)
# Once again remove packages after reboot
remove_installed_packages(ctx)