Commit e3646f22 authored by Iustin Pop's avatar Iustin Pop

Move the “--mac-prefix” option to cli.py

The default has also been changed to None as this will be useful once
cluster modify will be able to change this setting too.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 58371861
......@@ -69,6 +69,7 @@ __all__ = [
"IGNORE_FAILURES_OPT",
"IGNORE_SIZE_OPT",
"FORCE_OPT",
"MAC_PREFIX_OPT",
"MC_OPT",
"NET_OPT",
"NEW_SECONDARY_OPT",
......@@ -752,6 +753,12 @@ NOVOTING_OPT = cli_option("--no-voting", dest="no_voting",
help="Skip node agreement check (dangerous)",
action="store_true", default=False)
MAC_PREFIX_OPT = cli_option("-m", "--mac-prefix", dest="mac_prefix",
help="Specify the mac prefix for the instance IP"
" addresses, in the format XX:XX:XX",
metavar="PREFIX",
default=None)
def _ParseArgs(argv, commands, aliases):
"""Parser for the command line arguments.
......
......@@ -84,6 +84,9 @@ def InitCluster(opts, args):
if opts.candidate_pool_size is None:
opts.candidate_pool_size = constants.MASTER_POOL_SIZE_DEFAULT
if opts.mac_prefix is None:
opts.mac_prefix = constants.DEFAULT_MAC_PREFIX
bootstrap.InitCluster(cluster_name=args[0],
secondary_ip=opts.secondary_ip,
vg_name=vg_name,
......@@ -595,11 +598,7 @@ commands = {
'init': (InitCluster, [ArgHost(min=1, max=1)],
[DEBUG_OPT,
SECONDARY_IP_OPT,
cli_option("-m", "--mac-prefix", dest="mac_prefix",
help="Specify the mac prefix for the instance IP"
" addresses, in the format XX:XX:XX",
metavar="PREFIX",
default=constants.DEFAULT_MAC_PREFIX,),
MAC_PREFIX_OPT,
VG_NAME_OPT,
cli_option("--master-netdev", dest="master_netdev",
help="Specify the node interface (cluster-wide)"
......
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