From afe047a77f0105678fc949fab7dc0450c256bca7 Mon Sep 17 00:00:00 2001 From: Maxime Guyot Date: Fri, 20 Mar 2020 21:18:06 +0100 Subject: [PATCH] Add documentation for scripts/openstack-cleanup (#5803) --- scripts/openstack-cleanup/README.md | 21 +++++++++++++++++++++ scripts/openstack-cleanup/main.py | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 scripts/openstack-cleanup/README.md diff --git a/scripts/openstack-cleanup/README.md b/scripts/openstack-cleanup/README.md new file mode 100644 index 000000000..737d2f692 --- /dev/null +++ b/scripts/openstack-cleanup/README.md @@ -0,0 +1,21 @@ +# openstack-cleanup + +Tool to deletes openstack servers older than a specific age (default 4h). + +Useful to cleanup orphan servers that are left behind when CI is manually cancelled or fails unexpectedly. + +## Installation + +```shell +pip install -r requirements.txt +python main.py --help +``` + +## Usage + +```console +$ python main.py +This will delete VMs... (ctrl+c to cancel) +Will delete server example1 +Will delete server example2 +``` diff --git a/scripts/openstack-cleanup/main.py b/scripts/openstack-cleanup/main.py index 00c2ad5ed..e7098142f 100755 --- a/scripts/openstack-cleanup/main.py +++ b/scripts/openstack-cleanup/main.py @@ -16,7 +16,7 @@ parser = argparse.ArgumentParser(description='Cleanup OpenStack VMs') parser.add_argument('-v', '--verbose', action='store_true', help='Increase verbosity') parser.add_argument('--hours', type=int, default=4, - help='Age (in hours) of VMs to cleanup') + help='Age (in hours) of VMs to cleanup (default: 4h)') parser.add_argument('--dry-run', action='store_true', help='Do not delete anything')