python/samba/kcc: PY3 fix some str versus ldb.bytes comparisons
authorNoel Power <noel.power@suse.com>
Thu, 8 Nov 2018 18:47:59 +0000 (18:47 +0000)
committerNoel Power <npower@samba.org>
Mon, 10 Dec 2018 09:38:22 +0000 (10:38 +0100)
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/kcc/kcc_utils.py

index 9959637836f38dc1039cb18fc8163882eb11e705..81d381abd99548ac4c0dc8a11390f9cb43c3ff8b 100644 (file)
@@ -669,7 +669,7 @@ class DirectoryServiceAgent(object):
         if "options" in msg:
             self.options = int(msg["options"][0])
 
-        if "msDS-isRODC" in msg and msg["msDS-isRODC"][0] == "TRUE":
+        if "msDS-isRODC" in msg and str(msg["msDS-isRODC"][0]) == "TRUE":
             self.dsa_is_ro = True
         else:
             self.dsa_is_ro = False
@@ -972,7 +972,7 @@ class NTDSConnection(object):
             self.options = int(msg["options"][0])
 
         if "enabledConnection" in msg:
-            if msg["enabledConnection"][0].upper().lstrip().rstrip() == "TRUE":
+            if str(msg["enabledConnection"][0]).upper().lstrip().rstrip() == "TRUE":
                 self.enabled = True
 
         if "systemFlags" in msg:
@@ -1353,7 +1353,7 @@ class Partition(NamingContext):
                 continue
 
             if k == "Enabled":
-                if msg[k][0].upper().lstrip().rstrip() == "TRUE":
+                if str(msg[k][0]).upper().lstrip().rstrip() == "TRUE":
                     self.enabled = True
                 else:
                     self.enabled = False