From f70bb622cb36fd7626c44b92726d3eb181071980 Mon Sep 17 00:00:00 2001
From: Michael Hanselmann <hansmi@google.com>
Date: Fri, 13 Apr 2012 21:11:21 +0200
Subject: [PATCH] gnt-instance: Add "--submit" and "--priority" to commands

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
---
 lib/client/gnt_instance.py |  8 ++++----
 man/gnt-instance.rst       | 19 +++++++++++++------
 2 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/lib/client/gnt_instance.py b/lib/client/gnt_instance.py
index 0f70021e8..ec709b1e9 100644
--- a/lib/client/gnt_instance.py
+++ b/lib/client/gnt_instance.py
@@ -868,7 +868,7 @@ def MigrateInstance(opts, args):
                                  allow_failover=opts.allow_failover,
                                  allow_runtime_changes=opts.allow_runtime_chgs,
                                  ignore_ipolicy=opts.ignore_ipolicy)
-  SubmitOpCode(op, cl=cl, opts=opts)
+  SubmitOrSend(op, cl=cl, opts=opts)
   return 0
 
 
@@ -1439,7 +1439,7 @@ def ChangeGroup(opts, args):
                                      iallocator=opts.iallocator,
                                      target_groups=opts.to,
                                      early_release=opts.early_release)
-  result = SubmitOpCode(op, cl=cl, opts=opts)
+  result = SubmitOrSend(op, opts, cl=cl)
 
   # Keep track of submitted jobs
   jex = JobExecutor(cl=cl, opts=opts)
@@ -1541,7 +1541,7 @@ commands = {
     MigrateInstance, ARGS_ONE_INSTANCE,
     [FORCE_OPT, NONLIVE_OPT, MIGRATION_MODE_OPT, CLEANUP_OPT, DRY_RUN_OPT,
      PRIORITY_OPT, DST_NODE_OPT, IALLOCATOR_OPT, ALLOW_FAILOVER_OPT,
-     IGNORE_IPOLICY_OPT, NORUNTIME_CHGS_OPT],
+     IGNORE_IPOLICY_OPT, NORUNTIME_CHGS_OPT, SUBMIT_OPT],
     "[-f] <instance>", "Migrate instance to its secondary node"
     " (only for mirrored instances)"),
   "move": (
@@ -1643,7 +1643,7 @@ commands = {
     "<instance> <disk> <size>", "Grow an instance's disk"),
   "change-group": (
     ChangeGroup, ARGS_ONE_INSTANCE,
-    [TO_GROUP_OPT, IALLOCATOR_OPT, EARLY_RELEASE_OPT],
+    [TO_GROUP_OPT, IALLOCATOR_OPT, EARLY_RELEASE_OPT, PRIORITY_OPT, SUBMIT_OPT],
     "[-I <iallocator>] [--to <group>]", "Change group of instance"),
   "list-tags": (
     ListTags, ARGS_ONE_INSTANCE, [],
diff --git a/man/gnt-instance.rst b/man/gnt-instance.rst
index c38c553dc..fbfeef3c5 100644
--- a/man/gnt-instance.rst
+++ b/man/gnt-instance.rst
@@ -1446,12 +1446,12 @@ Example::
 MIGRATE
 ^^^^^^^
 
-**migrate** [-f] {\--cleanup} {*instance*}
+| **migrate** [-f] [\--allow-failover] [\--non-live]
+| [\--migration-mode=live\|non-live] [\--ignore-ipolicy]
+| [\--no-runtime-changes] [\--submit]
+| [{-n|\--target-node} *node* \| {-I|\--iallocator} *name*] {*instance*}
 
-**migrate** [-f] [\--allow-failover] [\--non-live]
-[\--migration-mode=live\|non-live] [\--ignore-ipolicy]
-[\--no-runtime-changes]
-[{-n|\--target-node} *node* \| {-I|\--iallocator} *name*] {*instance*}
+| **migrate** [-f] \--cleanup [\--submit] {*instance*}
 
 Migrate will move the instance to its secondary node without shutdown.
 As with failover, it only works for instances having the drbd disk
@@ -1501,6 +1501,9 @@ The ``--no-runtime-changes`` option forbids migrate to alter an
 instance's runtime before migrating it (eg. ballooning an instance
 down because the target node doesn't have enough available memory).
 
+See **ganeti(7)** for a description of ``--submit`` and other common
+options.
+
 Example (and expected output)::
 
     # gnt-instance migrate instance1
@@ -1562,7 +1565,8 @@ Example::
 CHANGE-GROUP
 ~~~~~~~~~~~~
 
-**change-group** [\--iallocator *NAME*] [\--to *GROUP*...] {*instance*}
+| **change-group** [\--submit]
+| [\--iallocator *NAME*] [\--to *GROUP*...] {*instance*}
 
 This command moves an instance to another node group. The move is
 calculated by an iallocator, either given on the command line or as a
@@ -1571,6 +1575,9 @@ cluster default.
 If no specific destination groups are specified using ``--to``, all
 groups except the one containing the instance are considered.
 
+See **ganeti(7)** for a description of ``--submit`` and other common
+options.
+
 Example::
 
     # gnt-instance change-group -I hail --to rack2 inst1.example.com
-- 
GitLab