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 10:49:26 +0000 (11:49 +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>
(cherry picked from commit 6426fb39e7adabb89e93263290ac9e62740c7bb2)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 235b799c4ae7734c56cae9ea96beed8b770ee37d)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>

contrib/spoa_server/ps_python.c

index 8c2ff6d..fbee2d0 100644 (file)
@@ -66,7 +66,7 @@ static PyObject *ps_python_set_var_null(PyObject *self, PyObject *args)
        if (!PyArg_ParseTuple(args, "s#i", &name, &name_len, &scope))
                return NULL;
        if (!set_var_null(worker, name, name_len, scope)) {
-               PyErr_SetString(spoa_error, "No space left available");
+               PyErr_SetString(spoa_error, "No more memory space available");
                return NULL;
        }
        Py_RETURN_NONE;
@@ -82,7 +82,7 @@ static PyObject *ps_python_set_var_boolean(PyObject *self, PyObject *args)
        if (!PyArg_ParseTuple(args, "s#ii", &name, &name_len, &scope, &value))
                return NULL;
        if (!set_var_bool(worker, name, name_len, scope, value)) {
-               PyErr_SetString(spoa_error, "No space left available");
+               PyErr_SetString(spoa_error, "No more memory space available");
                return NULL;
        }
        Py_RETURN_NONE;
@@ -98,7 +98,7 @@ static PyObject *ps_python_set_var_int32(PyObject *self, PyObject *args)
        if (!PyArg_ParseTuple(args, "s#ii", &name, &name_len, &scope, &value))
                return NULL;
        if (!set_var_int32(worker, name, name_len, scope, value)) {
-               PyErr_SetString(spoa_error, "No space left available");
+               PyErr_SetString(spoa_error, "No more memory space available");
                return NULL;
        }
        Py_RETURN_NONE;
@@ -114,7 +114,7 @@ static PyObject *ps_python_set_var_uint32(PyObject *self, PyObject *args)
        if (!PyArg_ParseTuple(args, "s#iI", &name, &name_len, &scope, &value))
                return NULL;
        if (!set_var_uint32(worker, name, name_len, scope, value)) {
-               PyErr_SetString(spoa_error, "No space left available");
+               PyErr_SetString(spoa_error, "No more memory space available");
                return NULL;
        }
        Py_RETURN_NONE;
@@ -130,7 +130,7 @@ static PyObject *ps_python_set_var_int64(PyObject *self, PyObject *args)
        if (!PyArg_ParseTuple(args, "s#il", &name, &name_len, &scope, &value))
                return NULL;
        if (!set_var_int64(worker, name, name_len, 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_uint64(PyObject *self, PyObject *args)
        if (!PyArg_ParseTuple(args, "s#ik", &name, &name_len, &scope, &value))
                return NULL;
        if (!set_var_uint64(worker, name, name_len, scope, value)) {
-               PyErr_SetString(spoa_error, "No space left available");
+               PyErr_SetString(spoa_error, "No more memory space available");
                return NULL;
        }
        Py_RETURN_NONE;
@@ -177,7 +177,7 @@ static PyObject *ps_python_set_var_ipv4(PyObject *self, PyObject *args)
        }
        memcpy(&ip, PyString_AS_STRING(value), PyString_GET_SIZE(value));
        if (!set_var_ipv4(worker, name, name_len, 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... */
@@ -210,7 +210,7 @@ static PyObject *ps_python_set_var_ipv6(PyObject *self, PyObject *args)
        }
        memcpy(&ip, PyString_AS_STRING(value), PyString_GET_SIZE(value));
        if (!set_var_ipv6(worker, name, name_len, 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... */
@@ -229,7 +229,7 @@ static PyObject *ps_python_set_var_str(PyObject *self, PyObject *args)
        if (!PyArg_ParseTuple(args, "s#is#", &name, &name_len, &scope, &value, &value_len))
                return NULL;
        if (!set_var_string(worker, name, name_len, scope, value, value_len)) {
-               PyErr_SetString(spoa_error, "No space left available");
+               PyErr_SetString(spoa_error, "No more memory space available");
                return NULL;
        }
        Py_RETURN_NONE;
@@ -246,7 +246,7 @@ static PyObject *ps_python_set_var_bin(PyObject *self, PyObject *args)
        if (!PyArg_ParseTuple(args, "s#is#", &name, &name_len, &scope, &value, &value_len))
                return NULL;
        if (!set_var_bin(worker, name, name_len, scope, value, value_len)) {
-               PyErr_SetString(spoa_error, "No space left available");
+               PyErr_SetString(spoa_error, "No more memory space available");
                return NULL;
        }
        Py_RETURN_NONE;