---
lib/cli.py | 5 +++++
scripts/gnt-cluster | 6 +-----
scripts/gnt-node | 4 +---
3 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/lib/cli.py b/lib/cli.py
index 35eb83b..273a7a9 100644
--- a/lib/cli.py
+++ b/lib/cli.py
@@ -79,6 +79,7 @@ __all__ = [
"ON_SECONDARY_OPT",
"OS_OPT",
"OS_SIZE_OPT",
+ "SECONDARY_IP_OPT",
"SELECT_OS_OPT",
"SEP_OPT",
"SHOWCMD_OPT",
@@ -676,6 +677,10 @@ SRC_NODE_OPT = cli_option("--src-node", dest="src_node",
help="Source node",
SRC_DIR_OPT = cli_option("--src-dir", dest="src_dir", help="Source directory",
metavar="<dir>")
+SECONDARY_IP_OPT = cli_option("-s", "--secondary-ip", dest="secondary_ip",
+ help="Specify the secondary ip for the node",
+ metavar="ADDRESS", default=None)
+
def _ParseArgs(argv, commands, aliases):
"""Parser for the command line arguments.
diff --git a/scripts/gnt-cluster b/scripts/gnt-cluster
index f939e30..2ff7a52 100755
--- a/scripts/gnt-cluster
+++ b/scripts/gnt-cluster
@@ -589,11 +589,7 @@ def WatcherOps(opts, args):
commands = {
'init': (InitCluster, [ArgHost(min=1, max=1)],
[DEBUG_OPT,
- cli_option("-s", "--secondary-ip", dest="secondary_ip",
- help="Specify the secondary ip for this node;"
- " if given, the entire cluster must have secondary"
- " addresses",
- metavar="ADDRESS", default=None),
+ 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",
diff --git a/scripts/gnt-node b/scripts/gnt-node
index 75dca86..4e5e419 100755
--- a/scripts/gnt-node
+++ b/scripts/gnt-node
@@ -624,9 +624,7 @@ def SetNodeParams(opts, args):
commands = {
'add': (AddNode, [ArgHost(min=1, max=1)],
[DEBUG_OPT,
- cli_option("-s", "--secondary-ip", dest="secondary_ip",
- help="Specify the secondary ip for the node",
- metavar="ADDRESS", default=None),
+ SECONDARY_IP_OPT,
cli_option("--readd", dest="readd",
default=False, action="store_true",
help="Readd old node after replacing it"),
--
1.6.3.3