Change in ovirt-engine-sdk[sdk_3.5]: codegen: Fix naming conflict

juan.hernandez at redhat.com juan.hernandez at redhat.com
Fri Jul 18 07:42:38 UTC 2014


Juan Hernandez has submitted this change and it was merged.

Change subject: codegen: Fix naming conflict
......................................................................


codegen: Fix naming conflict

Currently the code generator generates conflicting classes when the
calculated name of a entity is the same of a collection. For example,
for the following collection:

  /hosts/{host:id}/storage

Note that the name of the collection doesn't end in "s". As a result the
code generator produces a HostStorage class for the collection and a
HostStorage (same name) class for the entity. Due to the order they are
generated the collection class overwrites the entity class.

To avoid this issue this patch changes the code generator so that it
will automaticall add the "s" to the collection class name when there is
a conflict like this.

Change-Id: Ia408b8e16234595b4454c2d252f5fec16414ca49
Bug-Url: https://bugzilla.redhat.com/1120502
Signed-off-by: Juan Hernandez <juan.hernandez at redhat.com>
(cherry picked from commit 6bc4526a9f5fa761cd9f64cc7b311fd57e1c3628)
---
M src/codegen/rsdl/rsdlcodegen.py
1 file changed, 7 insertions(+), 0 deletions(-)

Approvals:
  Juan Hernandez: Verified; Looks good to me, approved



-- 
To view, visit http://gerrit.ovirt.org/30251
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia408b8e16234595b4454c2d252f5fec16414ca49
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine-sdk
Gerrit-Branch: sdk_3.5
Gerrit-Owner: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: automation at ovirt.org



More information about the Engine-commits mailing list