[libvirt] [libvirt-test-API][PATCH] fix the problem of return None value of self.conn

Osier Yang jyang at redhat.com
Tue Aug 16 07:29:14 UTC 2011


于 2011年08月16日 15:18, Wayne Sun 写道:
> ---
>   lib/connectAPI.py |    6 +++---
>   1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/lib/connectAPI.py b/lib/connectAPI.py
> index 702a088..cfa4fea 100644
> --- a/lib/connectAPI.py
> +++ b/lib/connectAPI.py
> @@ -44,7 +44,7 @@ class ConnectAPI(object):
>
>       def open(self, uri):
>           try:
> -            conn = libvirt.open(uri)
> +            self.conn = libvirt.open(uri)
>               return self.conn
>           except libvirt.libvirtError, e:
>               message = e.get_error_message()
> @@ -53,7 +53,7 @@ class ConnectAPI(object):
>
>       def open_read_only(self, uri):
>           try:
> -            conn = libvirt.openReadOnly(uri)
> +            self.conn = libvirt.openReadOnly(uri)
>               return self.conn
>           except libvirt.libvirtError, e:
>               message = e.get_error_message()
> @@ -62,7 +62,7 @@ class ConnectAPI(object):
>
>       def openAuth(self, uri, auth, flags = 0):
>           try:
> -            conn = libvirt.openAuth(uri, auth, flags)
> +            self.conn = libvirt.openAuth(uri, auth, flags)
>               return self.conn
>           except libvirt.libvirtError, e:
>               message = e.get_error_message()

ACK

Osier




More information about the libvir-list mailing list