Juan Hernandez has uploaded a new change for review. Change subject: codegen: Sort subcollection fields ......................................................................
codegen: Sort subcollection fields The code generator doesn't sort the fields containing references to subcollections. This means that the generated code may be different depending on the default order of dictionaries, or the order of collections in the XML schema and RSDL files. To avoid potential uncessary changes this patch changes the code generator so that the fields are generated in alphabetical order. Change-Id: Ib4d9af8282d7e7fc0b9fb06e85c1dad1b62355ff Signed-off-by: Juan Hernandez <[email protected]> (cherry picked from commit e76524ba08ca5c860773829bdbb0266c6ec23cdc) --- M src/codegen/resource/resource.py 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine-sdk refs/changes/22/27222/1 diff --git a/src/codegen/resource/resource.py b/src/codegen/resource/resource.py index cf5500a..a3af580 100644 --- a/src/codegen/resource/resource.py +++ b/src/codegen/resource/resource.py @@ -67,7 +67,8 @@ tmpl = " self.%s = %s(%s, context)\n" new_tmpl = '' - for k, v in sub_collections.items(): + for k in sorted(sub_collections): + v = sub_collections[k] new_tmpl += tmpl % (k.lower(), v, parent) return new_tmpl -- To view, visit http://gerrit.ovirt.org/27222 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib4d9af8282d7e7fc0b9fb06e85c1dad1b62355ff Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine-sdk Gerrit-Branch: sdk_3.4 Gerrit-Owner: Juan Hernandez <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
