Remove module 'ganeti.constants' from 'convert-constants'
[ganeti-local] / autotools / build-rpc
index a862d94..2de71d5 100755 (executable)
@@ -125,7 +125,7 @@ def _WriteBaseClass(sw, clsname, calls):
         raise ValueError("Procedure %s has only %d elements, expected %d" %
                          (v[0], len(v), _RPC_DEF_LEN))
 
-    for (name, kind, _, timeout, args, _, _, desc) in calls:
+    for (name, kind, _, timeout, args, _, _, desc) in sorted(calls):
       funcargs = ["self"]
 
       if kind == _SINGLE:
@@ -151,7 +151,7 @@ def _WriteBaseClass(sw, clsname, calls):
         buf.write("return ")
 
         # In case line gets too long and is wrapped in a bad spot
-        buf.write("( ")
+        buf.write("(")
 
         buf.write("self._Call(_def, ")
         if kind == _SINGLE:
@@ -201,7 +201,7 @@ def main():
       raise Exception("Found duplicate RPC definitions for '%s'" %
                       utils.CommaJoin(sorted(dups)))
 
-    for (clsname, calls) in module.CALLS.items():
+    for (clsname, calls) in sorted(module.CALLS.items()):
       _WriteBaseClass(sw, clsname, calls.values())
 
   print buf.getvalue()