summaryrefslogtreecommitdiff
path: root/libvirt-override.c
diff options
context:
space:
mode:
authorNir Soffer <nirsof@gmail.com>2019-03-11 23:34:50 +0200
committerPeter Krempa <pkrempa@redhat.com>2019-03-12 08:48:45 +0100
commit5d6228d4171c0a9d1299ad742dc878092287675a (patch)
tree5b27888e3caf659c12abff8bb9f1dc820d554fe0 /libvirt-override.c
parent54e430448efa7bf1120423d289b41a97bcb04218 (diff)
downloadlibvirt-python-5d6228d4171c0a9d1299ad742dc878092287675a.tar.gz
Fix handling of optional params in blockCopy()
Commit 2b4bd07e0a22 (Add check for params, nparams being a dictionary) changed the way the optional params argument is treated. If libvirt.virDomain.blockCopy() is called without specifying params, params is None, and the call will fail with: TypeError: block params must be a dictionary This is wrong as params is defined as kwarg, breaking existing libvirt users like oVirt. Add a check for Py_None, so we accept either a dict or None and fail with TypeError with anything else. Resolves: https://bugzilla.redhat.com/1687114 Signed-off-by: Nir Soffer <nsoffer@redhat.com>
Diffstat (limited to 'libvirt-override.c')
-rw-r--r--libvirt-override.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libvirt-override.c b/libvirt-override.c
index 857c018..c5e2908 100644
--- a/libvirt-override.c
+++ b/libvirt-override.c
@@ -8837,7 +8837,7 @@ libvirt_virDomainBlockCopy(PyObject *self ATTRIBUTE_UNUSED,
VIR_N_ELEMENTS(virPyDomainBlockCopyParams)) < 0) {
return NULL;
}
- } else {
+ } else if (pyobj_dict != Py_None) {
PyErr_Format(PyExc_TypeError, "block params must be a dictionary");
return NULL;
}