]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
python: Fix networkLookupByUUID
authorPhilip Hahn <hahn@univention.de>
Wed, 17 Mar 2010 16:34:04 +0000 (12:34 -0400)
committerCole Robinson <crobinso@redhat.com>
Wed, 17 Mar 2010 16:34:04 +0000 (12:34 -0400)
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
python/libvirt-override-api.xml

diff --git a/AUTHORS b/AUTHORS
index 4b676e2d142d8d59be1049dfec6516bd03dccf22..f711b07a41966ac49e76a00c2faa67dc8516c0e3 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -94,6 +94,7 @@ Patches have also been contributed by:
   Rolf Eike Beer       <eike@sf-mail.de>
   Stefan Berger        <stefanb@us.ibm.com>
   Wolfgang Mauerer     <wolfgang.mauerer@siemens.com>
+  Philipp Hahn         <hahn@univention.de>
 
   [....send patches to get your name here....]
 
index 1260c0cbc613cc2deed09cc478e3c6c92d22c0af..e95c46a09b471f44d972264aa28c6294ac2f5cd1 100644 (file)
@@ -40,7 +40,7 @@
     <function name='virNetworkLookupByUUID' file='python'>
       <info>Try to lookup a network on the given hypervisor based on its UUID.</info>
       <return type='virNetworkPtr' info='a new network object or NULL in case of failure'/>
-      <arg name='conn' type='virNetworkPtr' info='pointer to the hypervisor connection'/>
+      <arg name='conn' type='virConnectPtr' info='pointer to the hypervisor connection'/>
       <arg name='uuid' type='const unsigned char *' info='the UUID string for the network, must be 16 bytes'/>
     </function>
     <function name='virDomainGetInfo' file='python'>