Ravi Nori has uploaded a new change for review.

Change subject: sdk: Update API fails in SDK & CLI for several entities
......................................................................

sdk: Update API fails in SDK & CLI for several entities

All update operations fail from cli and sdk

Change-Id: I48bbc667f9d50b3204c7b5eda5203878e212e527
Bug-Url: https://bugzilla.redhat.com/1122546
Signed-off-by: Ravi Nori <[email protected]>
---
M 
generator/src/main/java/org/ovirt/engine/sdk/generator/xsd/templates/SuperAttributesTemplate
1 file changed, 48 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine-sdk refs/changes/71/31371/1

diff --git 
a/generator/src/main/java/org/ovirt/engine/sdk/generator/xsd/templates/SuperAttributesTemplate
 
b/generator/src/main/java/org/ovirt/engine/sdk/generator/xsd/templates/SuperAttributesTemplate
index 547537b..6c075f8 100644
--- 
a/generator/src/main/java/org/ovirt/engine/sdk/generator/xsd/templates/SuperAttributesTemplate
+++ 
b/generator/src/main/java/org/ovirt/engine/sdk/generator/xsd/templates/SuperAttributesTemplate
@@ -1,4 +1,52 @@
 # Begin NOT_GENERATED
+def __setattr__(self, item, value):
+    if (value is not None and
+        not isinstance(value, list) and
+        ReflectionHelper.isModuleMember(
+            sys.modules['ovirtsdk.infrastructure.brokers'],
+            type(value)) and
+        not ReflectionHelper.isModuleMember(sys.modules[__name__],
+            type(value)) and
+        value.__dict__.has_key('superclass') and
+        value.superclass is not None and
+        value.superclass != BaseResource):
+        if (ReflectionHelper.isModuleMember(
+                sys.modules['ovirtsdk.infrastructure.brokers'],
+                type(self)) and
+           self.__dict__.has_key('superclass') and
+           self.superclass is not None):
+            object.__setattr__(self.superclass, item, value.superclass)
+        else:
+            object.__setattr__(self, item, value.superclass)
+    elif (not isinstance(value, list) and
+         ReflectionHelper.isModuleMember(
+                 sys.modules['ovirtsdk.infrastructure.brokers'],
+                 type(self)) and
+         self.__dict__.has_key('superclass') and
+         self.superclass is not None and
+         not ReflectionHelper.isModuleMember(
+                 sys.modules['ovirtsdk.infrastructure.brokers'],
+                 type(value)) and
+         item is not 'superclass' and
+         item is not 'parentclass'):
+        object.__setattr__(self.superclass, item, value)
+    elif isinstance(value, list):
+        parsed_list = []
+        for obj in value:
+            if (ReflectionHelper.isModuleMember(
+                    sys.modules['ovirtsdk.infrastructure.brokers'],
+                    type(obj)) and
+               obj.__dict__.has_key('superclass') and
+               obj.superclass is not None and
+               item is not 'superclass' and
+               item is not 'parentclass'):
+                parsed_list.append(obj.superclass)
+            else:
+                parsed_list.append(obj)
+        object.__setattr__(self, item, parsed_list)
+    else:
+        object.__setattr__(self, item, value)
+
 def __eq__(self, other):
     return Comparator.compare(self, other)
 


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I48bbc667f9d50b3204c7b5eda5203878e212e527
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine-sdk
Gerrit-Branch: sdk_3.5
Gerrit-Owner: Ravi Nori <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to