On Thu, Jan 15, 2009 at 07:27:08PM +0100, Iustin Pop wrote:
> 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.
> ---
> tools/burnin | 11 +++++++++--
> 1 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/tools/burnin b/tools/burnin
> index 80076b6..4b18120 100755
> --- a/tools/burnin
> +++ b/tools/burnin
> @@ -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.keep_instances:
> + self.Remove()
Err, sorry:
diff --git a/tools/burnin b/tools/burnin
index 4b18120..230c803 100755
--- a/tools/burnin
+++ b/tools/burnin
@@ -730,7 +730,7 @@ class Burner(object):
Log("Error detected: opcode buffer follows:\n\n")
Log(self.GetFeedbackBuf())
Log("\n\n")
- if not self.keep_instances:
+ if not self.opts.keep_instances:
self.Remove()
return 0
iustin