Commit 383a3591 authored by Iustin Pop's avatar Iustin Pop

Unify the “--enabled-hypervisors” option

This also required a change, as one of the cases used a different
default.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 831040bf
......@@ -56,6 +56,7 @@ __all__ = [
"DISK_OPT",
"DISK_TEMPLATE_OPT",
"DRAINED_OPT",
"ENABLED_HV_OPT",
"FIELDS_OPT",
"FILESTORE_DIR_OPT",
"FILESTORE_DRIVER_OPT",
......@@ -721,6 +722,11 @@ NOLVM_STORAGE_OPT = cli_option("--no-lvm-storage", dest="lvm_storage",
" (cluster-wide)",
action="store_false", default=True)
ENABLED_HV_OPT = cli_option("--enabled-hypervisors",
dest="enabled_hypervisors",
help="Comma-separated list of hypervisors",
type="string", default=None)
def _ParseArgs(argv, commands, aliases):
"""Parser for the command line arguments.
......
......@@ -58,6 +58,8 @@ def InitCluster(opts, args):
vg_name = constants.DEFAULT_VG
hvlist = opts.enabled_hypervisors
if hvlist is None:
hvlist = constants.DEFAULT_ENABLED_HYPERVISOR
hvlist = hvlist.split(",")
hvparams = dict(opts.hvparams)
......@@ -617,10 +619,7 @@ commands = {
help="Don't modify /etc/hosts"
" (cluster-wide)",
action="store_false", default=True,),
cli_option("--enabled-hypervisors", dest="enabled_hypervisors",
help="Comma-separated list of hypervisors",
type="string",
default=constants.DEFAULT_ENABLED_HYPERVISOR),
ENABLED_HV_OPT,
HVLIST_OPT,
BACKEND_OPT,
cli_option("-N", "--nic-parameters", dest="nicparams",
......@@ -710,9 +709,7 @@ commands = {
"and enable lvm based storage",
metavar="VG",),
NOLVM_STORAGE_OPT,
cli_option("--enabled-hypervisors", dest="enabled_hypervisors",
help="Comma-separated list of hypervisors",
type="string", default=None),
ENABLED_HV_OPT,
HVLIST_OPT,
BACKEND_OPT,
cli_option("-N", "--nic-parameters", dest="nicparams",
......
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