---
lib/cli.py | 7 +++++++
scripts/gnt-instance | 8 +-------
scripts/gnt-node | 9 +--------
3 files changed, 9 insertions(+), 15 deletions(-)
diff --git a/lib/cli.py b/lib/cli.py
index 28c486f..9062c2e 100644
--- a/lib/cli.py
+++ b/lib/cli.py
@@ -64,6 +64,7 @@ __all__ = [
"NOHDR_OPT",
"NOIPCHECK_OPT",
"NONICS_OPT",
+ "NONLIVE_OPT",
"NWSYNC_OPT",
"OS_OPT",
"OS_SIZE_OPT",
@@ -567,6 +568,12 @@ IGNORE_CONSIST_OPT = cli_option("--ignore-consistency",
help="Ignore the consistency of the disks on"
" the secondary")
+NONLIVE_OPT = cli_option("--non-live", dest="live",
+ default=True, action="store_false",
+ help="Do a non-live migration (this usually means"
+ " freeze the instance, save the state, transfer and"
+ " only then resume running on the secondary node)")
+
def _ParseArgs(argv, commands, aliases):
"""Parser for the command line arguments.
diff --git a/scripts/gnt-instance b/scripts/gnt-instance
index 7a293da..84a17e4 100755
--- a/scripts/gnt-instance
+++ b/scripts/gnt-instance
@@ -1407,13 +1407,7 @@ commands = {
"Stops the instance and starts it on the backup node, using"
" the remote mirror (only for instances of type drbd)"),
'migrate': (MigrateInstance, ARGS_ONE_INSTANCE,
- [DEBUG_OPT, FORCE_OPT,
- cli_option("--non-live", dest="live",
- default=True, action="store_false",
- help="Do a non-live migration (this usually means"
- " freeze the instance, save the state,"
- " transfer and only then resume running on the"
- " secondary node)"),
+ [DEBUG_OPT, FORCE_OPT, NONLIVE_OPT,
cli_option("--cleanup", dest="cleanup",
default=False, action="store_true",
help="Instead of performing the migration, try to"
diff --git a/scripts/gnt-node b/scripts/gnt-node
index 15dd03a..baf46f1 100755
--- a/scripts/gnt-node
+++ b/scripts/gnt-node
@@ -652,14 +652,7 @@ commands = {
"Stops the primary instances on a node and start them on their"
" secondary node (only for instances with drbd disk template)"),
'migrate': (MigrateNode, ARGS_ONE_NODE,
- [DEBUG_OPT, FORCE_OPT,
- cli_option("--non-live", dest="live",
- default=True, action="store_false",
- help="Do a non-live migration (this usually means"
- " freeze the instance, save the state,"
- " transfer and only then resume running on the"
- " secondary node)"),
- ],
+ [DEBUG_OPT, FORCE_OPT, NONLIVE_OPT],
"[-f] <node>",
"Migrate all the primary instance on a node away from it"
" (only for instances of type drbd)"),
--
1.6.3.3