diff options
author | Kristján Valur <kristjan@rvx.is> | 2019-02-27 16:03:16 +0000 |
---|---|---|
committer | Noel Power <npower@samba.org> | 2019-03-07 14:08:21 +0000 |
commit | a8b316d102e0e864dde4ab39cc20b98f32216ff4 (patch) | |
tree | 1a53acef51643bb68d3b7c2c0c2a1aa355d72c01 /libgpo | |
parent | 08b5b11b96c5325d314a0ec8dc9291542e255f6f (diff) | |
download | samba-a8b316d102e0e864dde4ab39cc20b98f32216ff4.tar.gz |
pygpo: Fix error handing when getting gpo unix path.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13822
Signed-off-by: Kristján Valur Jónsson <kristjan@rvx.is>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
Diffstat (limited to 'libgpo')
-rw-r--r-- | libgpo/pygpo.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/libgpo/pygpo.c b/libgpo/pygpo.c index ceb60e886bb..7ae3de31973 100644 --- a/libgpo/pygpo.c +++ b/libgpo/pygpo.c @@ -74,7 +74,7 @@ static PyObject *py_gpo_get_unix_path(PyObject *self, PyObject *args, { NTSTATUS status; const char *cache_dir = NULL; - PyObject *ret = Py_None; + PyObject *ret = NULL; char *unix_path = NULL; TALLOC_CTX *frame = NULL; static const char *kwlist[] = {"cache_dir", NULL}; @@ -86,9 +86,6 @@ static PyObject *py_gpo_get_unix_path(PyObject *self, PyObject *args, if (!PyArg_ParseTupleAndKeywords(args, kwds, "|s", discard_const_p(char *, kwlist), &cache_dir)) { - PyErr_SetString(PyExc_RuntimeError, - "Failed to parse arguments to " - "gpo_get_unix_path()"); goto out; } @@ -104,8 +101,9 @@ static PyObject *py_gpo_get_unix_path(PyObject *self, PyObject *args, status = gpo_get_unix_path(frame, cache_dir, gpo_ptr, &unix_path); if (!NT_STATUS_IS_OK(status)) { - PyErr_SetString(PyExc_RuntimeError, - "Failed to determine gpo unix path"); + PyErr_Format(PyExc_RuntimeError, + "Failed to determine gpo unix path: %s", + get_friendly_nt_error_msg(status)); goto out; } |