---
lib/cli.py | 7 +++++++
scripts/gnt-cluster | 21 +++------------------
2 files changed, 10 insertions(+), 18 deletions(-)
diff --git a/lib/cli.py b/lib/cli.py
index 9344169..d8afc49 100644
--- a/lib/cli.py
+++ b/lib/cli.py
@@ -102,6 +102,7 @@ __all__ = [
"TAG_SRC_OPT",
"USEUNITS_OPT",
"VERBOSE_OPT",
+ "VG_NAME_OPT",
# Generic functions for CLI programs
"GenericMain",
"GetClient",
@@ -737,6 +738,12 @@ CP_SIZE_OPT = cli_option("-C", "--candidate-pool-size",
default=None,
dest="candidate_pool_size", type="int",
help="Set the candidate pool size")
+VG_NAME_OPT = cli_option("-g", "--vg-name", dest="vg_name",
+ help="Enables LVM and specifies the volume group"
+ " name (cluster-wide) for disk allocation [xenvg]",
+ metavar="VG", default=None)
+
+
def _ParseArgs(argv, commands, aliases):
"""Parser for the command line arguments.
diff --git a/scripts/gnt-cluster b/scripts/gnt-cluster
index 32e012e..d6191d9 100755
--- a/scripts/gnt-cluster
+++ b/scripts/gnt-cluster
@@ -600,11 +600,7 @@ commands = {
" addresses, in the format XX:XX:XX",
metavar="PREFIX",
default=constants.DEFAULT_MAC_PREFIX,),
- cli_option("-g", "--vg-name", dest="vg_name",
- help="Specify the volume group name "
- " (cluster-wide) for disk allocation [xenvg]",
- metavar="VG",
- default=None,),
+ 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 "
@@ -700,19 +696,8 @@ commands = {
[DEBUG_OPT],
"{pause <timespec>|continue|info}", "Change watcher properties"),
'modify': (SetClusterParams, ARGS_NONE,
- [DEBUG_OPT,
- cli_option("-g", "--vg-name", dest="vg_name",
- help="Specify the volume group name "
- " (cluster-wide) for disk allocation "
- "and enable lvm based storage",
- metavar="VG",),
- NOLVM_STORAGE_OPT,
- ENABLED_HV_OPT,
- HVLIST_OPT,
- BACKEND_OPT,
- NIC_PARAMS_OPT,
- CP_SIZE_OPT,
- ],
+ [DEBUG_OPT, BACKEND_OPT, CP_SIZE_OPT, ENABLED_HV_OPT, HVLIST_OPT,
+ NIC_PARAMS_OPT, NOLVM_STORAGE_OPT, VG_NAME_OPT],
"[opts...]",
"Alters the parameters of the cluster"),
}
--
1.6.3.3