Commit 25be0c75 authored by Guido Trotter's avatar Guido Trotter
Browse files

Remove --master-netdev default value



Since the --master-netdev option is now used both at cluster init and at
cluster modify time, it cannot have a default value of DEFAULT_BRIDGE
(xen-br0) anymore. As such at cluster init we make the initialization
explicit if another value hasn't been passed. This fixes gnt-cluster
modify changing the master_netdev to xen-br0 if called without that
argument.
Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 3582eef6
......@@ -947,10 +947,11 @@ MAC_PREFIX_OPT = cli_option("-m", "--mac-prefix", dest="mac_prefix",
MASTER_NETDEV_OPT = cli_option("--master-netdev", dest="master_netdev",
help="Specify the node interface (cluster-wide)"
" on which the master IP address will be added "
" [%s]" % constants.DEFAULT_BRIDGE,
" on which the master IP address will be added"
" (cluster init default: %s)" %
constants.DEFAULT_BRIDGE,
metavar="NETDEV",
default=constants.DEFAULT_BRIDGE)
default=None)
GLOBAL_FILEDIR_OPT = cli_option("--file-storage-dir", dest="file_storage_dir",
help="Specify the default directory (cluster-"
......
......@@ -70,6 +70,10 @@ def InitCluster(opts, args):
if opts.drbd_storage and not opts.drbd_helper:
drbd_helper = constants.DEFAULT_DRBD_HELPER
master_netdev = opts.master_netdev
if master_netdev is None:
master_netdev = constants.DEFAULT_BRIDGE
hvlist = opts.enabled_hypervisors
if hvlist is None:
hvlist = constants.DEFAULT_ENABLED_HYPERVISOR
......@@ -124,7 +128,7 @@ def InitCluster(opts, args):
secondary_ip=opts.secondary_ip,
vg_name=vg_name,
mac_prefix=opts.mac_prefix,
master_netdev=opts.master_netdev,
master_netdev=master_netdev,
file_storage_dir=opts.file_storage_dir,
enabled_hypervisors=hvlist,
hvparams=hvparams,
......
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