andykimpe / rpms / 389-ds-base

Forked from rpms/389-ds-base 6 months ago
Clone

Blame SOURCES/0003-Issue-51091-healthcheck-json-report-fails-when-mappi.patch

d69b2b
From 7a62e72b81d75ebb844835619ecc97dbf5e21058 Mon Sep 17 00:00:00 2001
d69b2b
From: Mark Reynolds <mreynolds@redhat.com>
d69b2b
Date: Thu, 14 May 2020 09:38:20 -0400
d69b2b
Subject: [PATCH 03/12] Issue 51091 - healthcheck json report fails when
d69b2b
 mapping tree is deleted
d69b2b
d69b2b
Description:  We were passing the bename in bytes and not as a utf8 string.
d69b2b
              This caused the json dumping to fail.
d69b2b
d69b2b
relates: https://pagure.io/389-ds-base/issue/51091
d69b2b
d69b2b
Reviewed by: firstyear(Thanks!)
d69b2b
---
d69b2b
 src/lib389/lib389/backend.py | 6 +++---
d69b2b
 1 file changed, 3 insertions(+), 3 deletions(-)
d69b2b
d69b2b
diff --git a/src/lib389/lib389/backend.py b/src/lib389/lib389/backend.py
d69b2b
index e472d3de5..4f752f414 100644
d69b2b
--- a/src/lib389/lib389/backend.py
d69b2b
+++ b/src/lib389/lib389/backend.py
d69b2b
@@ -11,7 +11,7 @@ import copy
d69b2b
 import ldap
d69b2b
 from lib389._constants import *
d69b2b
 from lib389.properties import *
d69b2b
-from lib389.utils import normalizeDN, ensure_str, ensure_bytes,  assert_c
d69b2b
+from lib389.utils import normalizeDN, ensure_str, assert_c
d69b2b
 from lib389 import Entry
d69b2b
 
d69b2b
 # Need to fix this ....
d69b2b
@@ -488,10 +488,10 @@ class Backend(DSLdapObject):
d69b2b
 
d69b2b
         # Check for the missing mapping tree.
d69b2b
         suffix = self.get_attr_val_utf8('nsslapd-suffix')
d69b2b
-        bename = self.get_attr_val_bytes('cn')
d69b2b
+        bename = self.get_attr_val_utf8('cn')
d69b2b
         try:
d69b2b
             mt = self._mts.get(suffix)
d69b2b
-            if mt.get_attr_val_bytes('nsslapd-backend') != bename and mt.get_attr_val('nsslapd-state') != ensure_bytes('backend'):
d69b2b
+            if mt.get_attr_val_utf8('nsslapd-backend') != bename and mt.get_attr_val_utf8('nsslapd-state') != 'backend':
d69b2b
                 raise ldap.NO_SUCH_OBJECT("We have a matching suffix, but not a backend or correct database name.")
d69b2b
         except ldap.NO_SUCH_OBJECT:
d69b2b
             result = DSBLE0001
d69b2b
-- 
d69b2b
2.26.2
d69b2b