From 52875c6cb2c615d1070a456d0e1dcc708d5fd5db Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 17 Jul 2019 11:48:50 -0500 Subject: [PATCH] mgr/BaseMgrModule: handle unicode health detail strings Signed-off-by: Sage Weil --- src/mgr/BaseMgrModule.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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)); -- 2.39.5