From: Sage Weil Date: Wed, 17 Jul 2019 16:48:50 +0000 (-0500) Subject: mgr/BaseMgrModule: handle unicode health detail strings X-Git-Tag: v15.1.0~2091^2~6 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=52875c6cb2c615d1070a456d0e1dcc708d5fd5db;p=ceph-ci.git mgr/BaseMgrModule: handle unicode health detail strings Signed-off-by: Sage Weil --- diff --git a/src/mgr/BaseMgrModule.cc b/src/mgr/BaseMgrModule.cc index e636db068e7..02a37f6143f 100644 --- a/src/mgr/BaseMgrModule.cc +++ b/src/mgr/BaseMgrModule.cc @@ -296,9 +296,9 @@ ceph_set_health_checks(BaseMgrModule *self, PyObject *args) severity = HEALTH_ERR; } } else if (ks == "summary") { - if (!PyString_Check(v)) { + if (!PyString_Check(v) && !PyUnicode_Check(v)) { derr << __func__ << " check " << check_name - << " summary value not string" << dendl; + << " summary value not [unicode] string" << dendl; continue; } summary = PyString_AsString(v); @@ -310,9 +310,9 @@ ceph_set_health_checks(BaseMgrModule *self, PyObject *args) } for (int k = 0; k < PyList_Size(v); ++k) { PyObject *di = PyList_GET_ITEM(v, k); - if (!PyString_Check(di)) { + if (!PyString_Check(di) && !PyUnicode_Check(di)) { derr << __func__ << " check " << check_name - << " detail item " << k << " not a string" << dendl; + << " detail item " << k << " not a [unicode] string" << dendl; continue; } detail.push_back(PyString_AsString(di));