summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Power <noel.power@suse.com>2018-09-07 12:42:19 +0100
committerKarolin Seeger <kseeger@samba.org>2019-03-28 12:19:12 +0000
commit19a77a10b76c09d86000881cafd031bbcffd2985 (patch)
treea0c44d3989255894a6b52b42cff57e93cc2f642a
parent300d52de7e5ca115a9427b62c14bd20afc320015 (diff)
downloadsamba-19a77a10b76c09d86000881cafd031bbcffd2985.tar.gz
python/samba: PY3 port for ridalloc_exop test to work
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit fc13a1268a4a9de94efd312a8309aa55d331ae19)
-rw-r--r--python/samba/dbchecker.py9
-rw-r--r--python/samba/remove_dc.py4
2 files changed, 6 insertions, 7 deletions
diff --git a/python/samba/dbchecker.py b/python/samba/dbchecker.py
index 2619b9bc72e..6a44a46c61e 100644
--- a/python/samba/dbchecker.py
+++ b/python/samba/dbchecker.py
@@ -1979,8 +1979,7 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base)))
raise
else:
instancetype |= dsdb.INSTANCE_TYPE_NC_ABOVE
-
- if self.write_ncs is not None and str(nc_root) in self.write_ncs:
+ if self.write_ncs is not None and str(nc_root) in [str(x) for x in self.write_ncs]:
instancetype |= dsdb.INSTANCE_TYPE_WRITE
return instancetype
@@ -2100,10 +2099,10 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base)))
self.report("ERROR: Not fixing num_values(%d) for '%s' on '%s'" %
(len(obj[attrname]), attrname, str(obj.dn)))
else:
- object_rdn_val = obj[attrname][0]
+ object_rdn_val = str(obj[attrname][0])
if str(attrname).lower() == 'isdeleted':
- if obj[attrname][0] != "FALSE":
+ if str(obj[attrname][0]) != "FALSE":
isDeleted = True
if str(attrname).lower() == 'systemflags':
@@ -2278,7 +2277,7 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base)))
if str(attrname).lower() == "instancetype":
calculated_instancetype = self.calculate_instancetype(dn)
- if len(obj["instanceType"]) != 1 or obj["instanceType"][0] != str(calculated_instancetype):
+ if len(obj["instanceType"]) != 1 or int(obj["instanceType"][0]) != calculated_instancetype:
error_count += 1
self.err_wrong_instancetype(obj, calculated_instancetype)
diff --git a/python/samba/remove_dc.py b/python/samba/remove_dc.py
index 4c8ee892464..84360ed1503 100644
--- a/python/samba/remove_dc.py
+++ b/python/samba/remove_dc.py
@@ -221,7 +221,7 @@ def offline_remove_server(samdb, logger,
computer_dn = None
try:
- dnsHostName = msgs[0]["dnsHostName"][0]
+ dnsHostName = str(msgs[0]["dnsHostName"][0])
except KeyError:
dnsHostName = None
@@ -251,7 +251,7 @@ def offline_remove_server(samdb, logger,
samdb.delete(computer_dn, ["tree_delete:0"])
if "dnsHostName" in msgs[0]:
- dnsHostName = msgs[0]["dnsHostName"][0]
+ dnsHostName = str(msgs[0]["dnsHostName"][0])
if remove_dns_account:
res = samdb.search(expression="(&(objectclass=user)(cn=dns-%s)(servicePrincipalName=DNS/%s))" %