DOC: spoa/python: Rephrasing memory related error messages
authorGilchrist Dadaglo <dadaglo@amazon.com>
Tue, 8 Dec 2020 14:37:09 +0000 (14:37 +0000)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 14 Dec 2020 08:30:55 +0000 (09:30 +0100)
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.

(cherry picked from commit 85b25829bce67a8d8338350a9bc8845f0ed9c2ad)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>

contrib/spoa_server/ps_python.c

index ec97f30..380d5b3 100644 (file)
@@ -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;