From 7312b33d6fd69eebe2c9f87f3d88e4fc1321b0b1 Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Fri, 23 Jan 2009 13:33:41 +0000
Subject: [PATCH] Sort the instance names in batcher

In case we submit multiple instances via batcher, it's nicer to have the
sorted nicely.

Reviewed-by: imsnah
---
 scripts/gnt-instance | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/scripts/gnt-instance b/scripts/gnt-instance
index a57c7b4e3..80afc41f5 100755
--- a/scripts/gnt-instance
+++ b/scripts/gnt-instance
@@ -447,7 +447,9 @@ def BatchCreate(opts, args):
   # Iterate over the instances and do:
   #  * Populate the specs with default value
   #  * Validate the instance specs
-  for (name, specs) in instance_data.iteritems():
+  i_names = utils.NiceSort(instance_data.keys())
+  for name in i_names:
+    specs = instance_data[name]
     specs = _PopulateWithDefaults(specs)
     _Validate(specs)
 
-- 
GitLab