Sort the keyval keys to make them easier to read.
Signed-off-by: Jean-Marc Eurin <jmeurin@google.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@3405 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/client/common_lib/utils.py b/client/common_lib/utils.py
index 8b3d6ae..26d4217 100644
--- a/client/common_lib/utils.py
+++ b/client/common_lib/utils.py
@@ -218,10 +218,10 @@
escaped_tag = re.escape(type_tag)
key_regex = re.compile(r'^[-\.\w]+\{%s\}$' % escaped_tag)
try:
- for key, value in dictionary.iteritems():
+ for key in sorted(dictionary.keys()):
if not key_regex.search(key):
raise ValueError('Invalid key: %s' % key)
- keyval.write('%s=%s\n' % (key, value))
+ keyval.write('%s=%s\n' % (key, dictionary[key]))
finally:
keyval.close()