Commit 320eda24 authored by Iustin Pop's avatar Iustin Pop
Browse files

burnin: add option to not remove instances

This patch adds a burnin option to keep instances at the end, so that
debugging after a burnin failure is easier.

Also, we reorder the command line parsing and client query so that one
can use ./tools/burnin --help even on non-ganeti machines.

Reviewed-by: ultrotter
parent 25e7b43f
......@@ -88,8 +88,8 @@ class Burner(object):
self.instances = []
self.to_rem = []
self.opts = None
self.cl = cli.GetClient()
self.ParseOptions()
self.cl = cli.GetClient()
self.GetState()
def ClearFeedbackBuf(self):
......@@ -222,6 +222,12 @@ class Burner(object):
help="Enable checking of instance status via http,"
" looking for /hostname.txt that should contain the"
" name of the instance")
parser.add_option("-K", "--keep-instances", default=False,
action="store_true",
dest="keep_instances",
help="Leave instances on the cluster after burnin,"
" for investigation in case of errors or simply"
" to use them")
options, args = parser.parse_args()
......@@ -724,7 +730,8 @@ class Burner(object):
Log("Error detected: opcode buffer follows:\n\n")
Log(self.GetFeedbackBuf())
Log("\n\n")
self.Remove()
if not self.opts.keep_instances:
self.Remove()
return 0
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment