diff options
author | Richard Jones <rjones@redhat.com> | 2009-04-20 10:19:45 +0100 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2009-04-20 10:19:45 +0100 |
commit | 24ccbb29ac475187f51a27dcd318db2b4824a0c1 (patch) | |
tree | ecb06a1b2985b33b7bdd8dad6e222a380b274ac5 /python/guestfs-py.c | |
parent | aef3d2013fee188c9607f35657c45df88503cd64 (diff) | |
download | libguestfs-24ccbb29ac475187f51a27dcd318db2b4824a0c1.tar.gz libguestfs-24ccbb29ac475187f51a27dcd318db2b4824a0c1.tar.xz libguestfs-24ccbb29ac475187f51a27dcd318db2b4824a0c1.zip |
Generated code for 'checksum' command.
Diffstat (limited to 'python/guestfs-py.c')
-rw-r--r-- | python/guestfs-py.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/python/guestfs-py.c b/python/guestfs-py.c index 9969c538..4d31d9f7 100644 --- a/python/guestfs-py.c +++ b/python/guestfs-py.c @@ -2536,6 +2536,32 @@ py_guestfs_download (PyObject *self, PyObject *args) return py_r; } +static PyObject * +py_guestfs_checksum (PyObject *self, PyObject *args) +{ + PyObject *py_g; + guestfs_h *g; + PyObject *py_r; + char *r; + const char *csumtype; + const char *path; + + if (!PyArg_ParseTuple (args, (char *) "Oss:guestfs_checksum", + &py_g, &csumtype, &path)) + return NULL; + g = get_handle (py_g); + + r = guestfs_checksum (g, csumtype, path); + if (r == NULL) { + PyErr_SetString (PyExc_RuntimeError, guestfs_last_error (g)); + return NULL; + } + + py_r = PyString_FromString (r); + free (r); + return py_r; +} + static PyMethodDef methods[] = { { (char *) "create", py_guestfs_create, METH_VARARGS, NULL }, { (char *) "close", py_guestfs_close, METH_VARARGS, NULL }, @@ -2625,6 +2651,7 @@ static PyMethodDef methods[] = { { (char *) "blockdev_rereadpt", py_guestfs_blockdev_rereadpt, METH_VARARGS, NULL }, { (char *) "upload", py_guestfs_upload, METH_VARARGS, NULL }, { (char *) "download", py_guestfs_download, METH_VARARGS, NULL }, + { (char *) "checksum", py_guestfs_checksum, METH_VARARGS, NULL }, { NULL, NULL, 0, NULL } }; |