Skip to content
Snippets Groups Projects
Commit 519bfbae authored by Iustin Pop's avatar Iustin Pop
Browse files

Add option to burnin only a given set of nodes

This patch adds a '-n' option to burnin that takes a comma-separated
list of nodes to perform the burnin on.

Reviewed-by: ultrotter
parent 00fe9e38
No related branches found
No related tags found
No related merge requests found
......@@ -68,6 +68,9 @@ def ParseOptions():
choices=("remote_raid1", "drbd8"), default="remote_raid1",
help="Template type for network mirroring (remote_raid1"
" or drbd8) [remote_raid1]")
parser.add_option("-n", "--nodes", dest="nodes", default="",
help="Comma separated list of nodes to perform the burnin"
" on (defaults to all nodes)")
options, args = parser.parse_args()
if len(args) < 1 or options.os is None:
......@@ -86,8 +89,17 @@ def BurninCluster(opts, args):
logger.SetupLogging(debug=True, program="ganeti/burnin")
proc = mcpu.Processor(feedback=Feedback)
result = proc.ExecOpCode(opcodes.OpQueryNodes(output_fields=["name"],
names=[]))
if opts.nodes:
names = opts.nodes.split(",")
else:
names = []
try:
result = proc.ExecOpCode(opcodes.OpQueryNodes(output_fields=["name"],
names=names))
except errors.GenericError, err:
err_code, msg = cli.FormatError(err)
Feedback(msg)
return err_code
nodelist = [data[0] for data in result]
Feedback("- Testing global parameters")
......
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