Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
...@@ -88,8 +88,8 @@ class Burner(object): ...@@ -88,8 +88,8 @@ class Burner(object):
self.instances = [] self.instances = []
self.to_rem = [] self.to_rem = []
self.opts = None self.opts = None
self.cl = cli.GetClient()
self.ParseOptions() self.ParseOptions()
self.cl = cli.GetClient()
self.GetState() self.GetState()
def ClearFeedbackBuf(self): def ClearFeedbackBuf(self):
...@@ -222,6 +222,12 @@ class Burner(object): ...@@ -222,6 +222,12 @@ class Burner(object):
help="Enable checking of instance status via http," help="Enable checking of instance status via http,"
" looking for /hostname.txt that should contain the" " looking for /hostname.txt that should contain the"
" name of the instance") " 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() options, args = parser.parse_args()
...@@ -724,7 +730,8 @@ class Burner(object): ...@@ -724,7 +730,8 @@ class Burner(object):
Log("Error detected: opcode buffer follows:\n\n") Log("Error detected: opcode buffer follows:\n\n")
Log(self.GetFeedbackBuf()) Log(self.GetFeedbackBuf())
Log("\n\n") Log("\n\n")
self.Remove() if not self.opts.keep_instances:
self.Remove()
return 0 return 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment