Commit e32df528 authored by Iustin Pop's avatar Iustin Pop

Unify the “--candidate-pool-size” option

This required a slight tweak since in init we want a different default.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 4fbc93dd
......@@ -50,6 +50,7 @@ __all__ = [
"BACKEND_OPT",
"CLEANUP_OPT",
"CONFIRM_OPT",
"CP_SIZE_OPT",
"DEBUG_OPT",
"DEBUG_SIMERR_OPT",
"DISKIDX_OPT",
......@@ -732,6 +733,10 @@ NIC_PARAMS_OPT = cli_option("-N", "--nic-parameters", dest="nicparams",
type="keyval", default={},
help="NIC parameters")
CP_SIZE_OPT = cli_option("-C", "--candidate-pool-size", default=None,
dest="candidate_pool_size", type="int",
help="Set the candidate pool size")
def _ParseArgs(argv, commands, aliases):
"""Parser for the command line arguments.
......
......@@ -81,6 +81,9 @@ def InitCluster(opts, args):
hvparams[hv] = objects.FillDict(constants.HVC_DEFAULTS[hv], hvparams[hv])
utils.ForceDictType(hvparams[hv], constants.HVS_PARAMETER_TYPES)
if opts.candidate_pool_size is None:
opts.candidate_pool_size = constants.MASTER_POOL_SIZE_DEFAULT
bootstrap.InitCluster(cluster_name=args[0],
secondary_ip=opts.secondary_ip,
vg_name=vg_name,
......@@ -623,10 +626,7 @@ commands = {
HVLIST_OPT,
BACKEND_OPT,
NIC_PARAMS_OPT,
cli_option("-C", "--candidate-pool-size",
default=constants.MASTER_POOL_SIZE_DEFAULT,
help="Set the candidate pool size",
dest="candidate_pool_size", type="int"),
CP_SIZE_OPT,
],
"[opts...] <cluster_name>",
"Initialises a new cluster configuration"),
......@@ -711,9 +711,7 @@ commands = {
HVLIST_OPT,
BACKEND_OPT,
NIC_PARAMS_OPT,
cli_option("-C", "--candidate-pool-size", default=None,
help="Set the candidate pool size",
dest="candidate_pool_size", type="int"),
CP_SIZE_OPT,
],
"[opts...]",
"Alters the parameters of the cluster"),
......
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