[Kimchi-devel] [PATCH] issue #553: Use required parameter in "snapshotLookupByName"
Daniel Henrique Barboza
danielhb at linux.vnet.ibm.com
Fri Dec 12 11:04:07 UTC 2014
Reviewed-by: Daniel Barboza <danielhb at linux.vnet.ibm.com>
On 12/11/2014 04:23 PM, Crístian Viana wrote:
> The function "snapshotLookupByName" has a required parameter in
> older versions of libvirt. On newer versions, however, this parameter
> is optional and it was causing an error on RHEL because it uses an old
> version of libvirt.
>
> Always use the parameter in function "snapshotLookupByName" with its default
> value (0).
>
> Fix issue #553 ("Get snapshots of vm raise 500 error").
>
> Signed-off-by: Crístian Viana <vianac at linux.vnet.ibm.com>
> ---
> src/kimchi/model/vmsnapshots.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/kimchi/model/vmsnapshots.py b/src/kimchi/model/vmsnapshots.py
> index bb9bfaa..725770d 100644
> --- a/src/kimchi/model/vmsnapshots.py
> +++ b/src/kimchi/model/vmsnapshots.py
> @@ -165,7 +165,7 @@ class VMSnapshotModel(object):
> vir_dom = VMModel.get_vm(vm_name, self.conn)
>
> try:
> - return vir_dom.snapshotLookupByName(name)
> + return vir_dom.snapshotLookupByName(name, 0)
> except libvirt.libvirtError, e:
> code = e.get_error_code()
> if code == libvirt.VIR_ERR_NO_DOMAIN_SNAPSHOT:
More information about the Kimchi-devel
mailing list