From 2ef091efcc5cd02bbd496972b141cf253f713fdd Mon Sep 17 00:00:00 2001 From: Philip Hahn Date: Wed, 17 Mar 2010 12:34:04 -0400 Subject: [PATCH] python: Fix networkLookupByUUID According to: http://libvirt.org/html/libvirt-libvirt.html#virNetworkLookupByUUID virNetworkLookupByUUID() expects a virConnectPtr as its first argument, thus making it a method of the virConnect Python class. Currently it's a method of libvirt.virNetwork. @@ -805,13 +805,6 @@ class virNetwork: if ret == -1: raise libvirtError ('virNetworkGetAutostart() failed', net=self) return ret - def networkLookupByUUID(self, uuid): - """Try to lookup a network on the given hypervisor based on its UUID. """ - ret = libvirtmod.virNetworkLookupByUUID(self._o, uuid) - if ret is None:raise libvirtError('virNetworkLookupByUUID() failed', net=self) - __tmp = virNetwork(self, _obj=ret) - return __tmp - class virInterface: def __init__(self, conn, _obj=None): self._conn = conn @@ -1689,6 +1682,13 @@ class virConnect: __tmp = virDomain(self,_obj=ret) return __tmp + def networkLookupByUUID(self, uuid): + """Try to lookup a network on the given hypervisor based on its UUID. """ + ret = libvirtmod.virNetworkLookupByUUID(self._o, uuid) + if ret is None:raise libvirtError('virNetworkLookupByUUID() failed', conn=self) + __tmp = virNetwork(self, _obj=ret) + return __tmp + --- AUTHORS | 1 + python/libvirt-override-api.xml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index 4b676e2d14..f711b07a41 100644 --- a/AUTHORS +++ b/AUTHORS @@ -94,6 +94,7 @@ Patches have also been contributed by: Rolf Eike Beer Stefan Berger Wolfgang Mauerer + Philipp Hahn [....send patches to get your name here....] diff --git a/python/libvirt-override-api.xml b/python/libvirt-override-api.xml index 1260c0cbc6..e95c46a09b 100644 --- a/python/libvirt-override-api.xml +++ b/python/libvirt-override-api.xml @@ -40,7 +40,7 @@ Try to lookup a network on the given hypervisor based on its UUID. - + -- 2.47.2