Antoni Segura Puimedon has posted comments on this change.
Change subject: PARTIAL: explicitly close libvirt connection after use
......................................................................
Patch Set 1: I would prefer that you didn't submit this
I'd rather modify the connection object in libvirtconnection.py in the
following way:
Top of the module:
import new
and before return connection do:
connection.__enter__ = new.instancemethod(lambda self: self, connection,
connection.__class__)
def conn_close(self, *args):
self.close()
connection.__exit__ = new.instancemethod(conn_close, connection,
connection.__class__)
This will allow the current usage as well as:
with libvirtconnection.get() as conn:
conn.xxxx
and automatically close.
--
To view, visit http://gerrit.ovirt.org/17192
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I2b15f3ab017828a63960ba9311fa2bf6bfab4729
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Antoni Segura Puimedon <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches