diff --git a/lib/cli.py b/lib/cli.py index 3c735432d4546a917be1a2bdef67f7dbf3b84bdc..233376060ca1078abed32041a33d7218ef36ce96 100644 --- a/lib/cli.py +++ b/lib/cli.py @@ -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. diff --git a/scripts/gnt-cluster b/scripts/gnt-cluster index e931032b788b42dcda3fb075de2bbc90de21eef1..bf4420243f0c6bec4993e1fc462fcf7b4ff1a051 100755 --- a/scripts/gnt-cluster +++ b/scripts/gnt-cluster @@ -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)"