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

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