From dd7dcca76f3a5e6b065fc6fd63ac7116f0c05ad8 Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Fri, 22 May 2009 13:01:35 +0200
Subject: [PATCH] gnt-instance batch-create: use the job executor

This small patch changed the batch create functionality to use the job
executor instead of single-job submits.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
(cherry picked from commit d4dd4b74a786cd0f31e5fc530f140aaf438c68e7)
---
 scripts/gnt-instance | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/scripts/gnt-instance b/scripts/gnt-instance
index e7990baf6..aa524981b 100755
--- a/scripts/gnt-instance
+++ b/scripts/gnt-instance
@@ -441,6 +441,8 @@ def BatchCreate(opts, args):
     ToStderr("Can't parse the instance definition file: %s" % str(err))
     return 1
 
+  jex = JobExecutor()
+
   # Iterate over the instances and do:
   #  * Populate the specs with default value
   #  * Validate the instance specs
@@ -486,7 +488,9 @@ def BatchCreate(opts, args):
                                   file_storage_dir=specs['file_storage_dir'],
                                   file_driver=specs['file_driver'])
 
-    ToStdout("%s: %s", name, cli.SendJob([op]))
+    jex.QueueJob(name, op)
+  # we never want to wait, just show the submitted job IDs
+  jex.WaitOrShow(False)
 
   return 0
 
-- 
GitLab