]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/BaseMgrModule: handle unicode health detail strings
authorSage Weil <sage@redhat.com>
Wed, 17 Jul 2019 16:48:50 +0000 (11:48 -0500)
committerSage Weil <sage@redhat.com>
Fri, 19 Jul 2019 19:45:47 +0000 (14:45 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/mgr/BaseMgrModule.cc

index e636db068e7d3748831bf10cc6cb76e8cf4cbcfb..02a37f6143ff84bc00ae9aebcff9a615f4a40c61 100644 (file)
@@ -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));