Some of these should be added to cluster modify too.
---
lib/cli.py | 22 ++++++++++++++++++++++
scripts/gnt-cluster | 19 +++----------------
2 files changed, 25 insertions(+), 16 deletions(-)
diff --git a/lib/cli.py b/lib/cli.py
index bc2b704..bd0ac37 100644
--- a/lib/cli.py
+++ b/lib/cli.py
@@ -61,6 +61,7 @@ __all__ = [
"FIELDS_OPT",
"FILESTORE_DIR_OPT",
"FILESTORE_DRIVER_OPT",
+ "GLOBAL_FILEDIR_OPT",
"HVLIST_OPT",
"HVOPTS_OPT",
"HYPERVISOR_OPT",
@@ -70,6 +71,7 @@ __all__ = [
"IGNORE_SIZE_OPT",
"FORCE_OPT",
"MAC_PREFIX_OPT",
+ "MASTER_NETDEV_OPT",
"MC_OPT",
"NET_OPT",
"NEW_SECONDARY_OPT",
@@ -79,6 +81,7 @@ __all__ = [
"NOHDR_OPT",
"NOIPCHECK_OPT",
"NOLVM_STORAGE_OPT",
+ "NOMODIFY_ETCHOSTS_OPT",
"NONICS_OPT",
"NONLIVE_OPT",
"NOSTART_OPT",
@@ -759,6 +762,25 @@ MAC_PREFIX_OPT = cli_option("-m", "--mac-prefix",
dest="mac_prefix",
metavar="PREFIX",
default=None)
+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,
+ metavar="NETDEV",
+ default=constants.DEFAULT_BRIDGE)
+
+
+GLOBAL_FILEDIR_OPT = cli_option("--file-storage-dir", dest="file_storage_dir",
+ help="Specify the default directory (cluster-"
+ "wide) for storing the file-based disks [%s]" %
+ constants.DEFAULT_FILE_STORAGE_DIR,
+ metavar="DIR",
+ default=constants.DEFAULT_FILE_STORAGE_DIR)
+
+NOMODIFY_ETCHOSTS_OPT = cli_option("--no-etc-hosts", dest="modify_etc_hosts",
+ help="Don't modify /etc/hosts",
+ action="store_false", default=True)
+
def _ParseArgs(argv, commands, aliases):
"""Parser for the command line arguments.
diff --git a/scripts/gnt-cluster b/scripts/gnt-cluster
index bf44202..c2f907d 100755
--- a/scripts/gnt-cluster
+++ b/scripts/gnt-cluster
@@ -600,23 +600,10 @@ commands = {
SECONDARY_IP_OPT,
MAC_PREFIX_OPT,
VG_NAME_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,
- metavar="NETDEV",
- default=constants.DEFAULT_BRIDGE,),
- cli_option("--file-storage-dir", dest="file_storage_dir",
- help="Specify the default directory (cluster-wide)"
- " for storing the file-based disks [%s]" %
- constants.DEFAULT_FILE_STORAGE_DIR,
- metavar="DIR",
- default=constants.DEFAULT_FILE_STORAGE_DIR,),
+ MASTER_NETDEV_OPT,
+ GLOBAL_FILEDIR_OPT,
NOLVM_STORAGE_OPT,
- cli_option("--no-etc-hosts", dest="modify_etc_hosts",
- help="Don't modify /etc/hosts"
- " (cluster-wide)",
- action="store_false", default=True,),
+ NOMODIFY_ETCHOSTS_OPT,
ENABLED_HV_OPT,
HVLIST_OPT,
BACKEND_OPT,
--
1.6.3.3