From 85b25829bce67a8d8338350a9bc8845f0ed9c2ad Mon Sep 17 00:00:00 2001 From: Gilchrist Dadaglo Date: Tue, 8 Dec 2020 14:37:09 +0000 Subject: [PATCH] DOC: spoa/python: Rephrasing memory related error messages The old message "No more space left available" was redundant with "left available". This commit is to rephrase that sentence and make it more explicit we are talking about memory This patch must be backported as far as 2.0. --- contrib/spoa_server/ps_python.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/contrib/spoa_server/ps_python.c b/contrib/spoa_server/ps_python.c index ec97f30f5..380d5b39f 100644 --- a/contrib/spoa_server/ps_python.c +++ b/contrib/spoa_server/ps_python.c @@ -106,7 +106,7 @@ static PyObject *ps_python_set_var_null(PyObject *self, PyObject *args) if (name_len_i == -1) return NULL; if (!set_var_null(worker, name, name_len_i, scope)) { - PyErr_SetString(spoa_error, "No space left available"); + PyErr_SetString(spoa_error, "No more memory space available"); return NULL; } Py_RETURN_NONE; @@ -126,7 +126,7 @@ static PyObject *ps_python_set_var_boolean(PyObject *self, PyObject *args) if (name_len_i == -1) return NULL; if (!set_var_bool(worker, name, name_len_i, scope, value)) { - PyErr_SetString(spoa_error, "No space left available"); + PyErr_SetString(spoa_error, "No more memory space available"); return NULL; } Py_RETURN_NONE; @@ -146,7 +146,7 @@ static PyObject *ps_python_set_var_int32(PyObject *self, PyObject *args) if (name_len_i == -1) return NULL; if (!set_var_int32(worker, name, name_len_i, scope, value)) { - PyErr_SetString(spoa_error, "No space left available"); + PyErr_SetString(spoa_error, "No more memory space available"); return NULL; } Py_RETURN_NONE; @@ -166,7 +166,7 @@ static PyObject *ps_python_set_var_uint32(PyObject *self, PyObject *args) if (name_len_i == -1) return NULL; if (!set_var_uint32(worker, name, name_len_i, scope, value)) { - PyErr_SetString(spoa_error, "No space left available"); + PyErr_SetString(spoa_error, "No more memory space available"); return NULL; } Py_RETURN_NONE; @@ -186,7 +186,7 @@ static PyObject *ps_python_set_var_int64(PyObject *self, PyObject *args) if (name_len_i == -1) return NULL; if (!set_var_int64(worker, name, name_len_i, scope, value)) { - PyErr_SetString(spoa_error, "No space left available"); + PyErr_SetString(spoa_error, "No more memory space available"); return NULL; } Py_RETURN_NONE; @@ -206,7 +206,7 @@ static PyObject *ps_python_set_var_uint64(PyObject *self, PyObject *args) if (name_len_i == -1) return NULL; if (!set_var_uint64(worker, name, name_len_i, scope, value)) { - PyErr_SetString(spoa_error, "No space left available"); + PyErr_SetString(spoa_error, "No more memory space available"); return NULL; } Py_RETURN_NONE; @@ -241,7 +241,7 @@ static PyObject *ps_python_set_var_ipv4(PyObject *self, PyObject *args) } memcpy(&ip, PY_STRING_AS_STRING(value), PY_STRING_GET_SIZE(value)); if (!set_var_ipv4(worker, name, name_len_i, scope, &ip)) { - PyErr_SetString(spoa_error, "No space left available"); + PyErr_SetString(spoa_error, "No more memory space available"); return NULL; } /* Once we set the IP value in the worker, we don't need it anymore... */ @@ -278,7 +278,7 @@ static PyObject *ps_python_set_var_ipv6(PyObject *self, PyObject *args) } memcpy(&ip, PY_STRING_AS_STRING(value), PY_STRING_GET_SIZE(value)); if (!set_var_ipv6(worker, name, name_len_i, scope, &ip)) { - PyErr_SetString(spoa_error, "No space left available"); + PyErr_SetString(spoa_error, "No more memory space available"); return NULL; } /* Once we set the IP value in the worker, we don't need it anymore... */ @@ -303,7 +303,7 @@ static PyObject *ps_python_set_var_str(PyObject *self, PyObject *args) if (name_len_i == -1 || value_len_i == -1) return NULL; if (!set_var_string(worker, name, name_len_i, scope, value, value_len_i)) { - PyErr_SetString(spoa_error, "No space left available"); + PyErr_SetString(spoa_error, "No more memory space available"); return NULL; } Py_RETURN_NONE; @@ -326,7 +326,7 @@ static PyObject *ps_python_set_var_bin(PyObject *self, PyObject *args) if (name_len_i == -1 || value_len_i == -1) return NULL; if (!set_var_bin(worker, name, name_len_i, scope, value, value_len_i)) { - PyErr_SetString(spoa_error, "No space left available"); + PyErr_SetString(spoa_error, "No more memory space available"); return NULL; } Py_RETURN_NONE;