Change in ovirt-engine-sdk[master]: Remove the connection attribute from objects

juan.hernandez at redhat.com juan.hernandez at redhat.com
Fri Mar 11 11:06:47 UTC 2016


Juan Hernandez has submitted this change and it was merged.

Change subject: Remove the connection attribute from objects
......................................................................


Remove the connection attribute from objects

Currently each object created by the SDK contains a "connection"
attribute that is used to implement the "follow_link" method. This is
problematic, because when the connection is closed there will be many
objects that have a non nil but useless connection. To avoid this
problem this patch removes this "connection" attribute and moves the
"follow_link" method to the "Connection" class. So instead of following
a link with this code:

  vm = ...
  cluster = vm.cluster.follow_link()

It is now necessary to explicitly use the connection:

  vm = ...
  cluster = connection.follow_link(vm.cluster)

Change-Id: Ibeebdfda7e108697c1823b9af549c43187419f8d
Signed-off-by: Juan Hernandez <juan.hernandez at redhat.com>
---
M generator/src/main/java/org/ovirt/sdk/python/ReadersGenerator.java
M generator/src/main/java/org/ovirt/sdk/python/ServicesGenerator.java
M sdk/examples/follow_vm_links.py
M sdk/lib/ovirtsdk4/http.py
M sdk/lib/ovirtsdk4/list.py
M sdk/lib/ovirtsdk4/struct.py
6 files changed, 58 insertions(+), 174 deletions(-)

Approvals:
  Juan Hernandez: Verified; Looks good to me, approved
  Jenkins CI: Passed CI tests



-- 
To view, visit https://gerrit.ovirt.org/54615
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibeebdfda7e108697c1823b9af549c43187419f8d
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine-sdk
Gerrit-Branch: master
Gerrit-Owner: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>



More information about the Engine-commits mailing list