ovsdb-idlc: With "doc" command, output tables and columns alphabetically.
authorBen Pfaff <blp@nicira.com>
Tue, 26 Jan 2010 17:32:38 +0000 (09:32 -0800)
committerBen Pfaff <blp@nicira.com>
Tue, 26 Jan 2010 17:32:38 +0000 (09:32 -0800)
Until this commit, tables and columns in output were output in random
order (according to the ordering of Python's internal hash table).
Alphabetical order makes more sense.

Thanks to Reid Price for useful Python tips.

ovsdb/ovsdb-idlc.in

index d70e5ebb618770a51a411b157f579129b309a053..716998267d62b54d6f64b8d47b2b1740351ae36a 100755 (executable)
@@ -659,7 +659,7 @@ def printDoc(schema):
     if schema.comment:
         print schema.comment
 
-    for tableName, table in schema.tables.iteritems():
+    for tableName, table in sorted(schema.tables.iteritems()):
         title = "%s table" % tableName
         print
         print title
@@ -667,7 +667,7 @@ def printDoc(schema):
         if table.comment:
             print table.comment
 
-        for columnName, column in table.columns.iteritems():
+        for columnName, column in sorted(table.columns.iteritems()):
             print
             print "%s (%s)" % (columnName, column.type.toEnglish())
             if column.comment: