The default has also been changed to None as this will be useful once
cluster modify will be able to change this setting too.
---
lib/cli.py | 7 +++++++
scripts/gnt-cluster | 9 ++++-----
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/lib/cli.py b/lib/cli.py
index cc7c21b..bc2b704 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 e931032..bf44202 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)"
--
1.6.3.3