summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorNoel Power <noel.power@suse.com>2018-08-10 18:07:11 +0100
committerAndrew Bartlett <abartlet@samba.org>2018-09-03 03:22:21 +0200
commit471163e82e1651f9051622be349a5e868db420bd (patch)
treeb2bc35c6e8387cca5f984a74b1a2ed9d7eb685a3 /python
parentbff4d80a23dcd7d61f24a7a4b6284ed980ee6a4c (diff)
downloadsamba-471163e82e1651f9051622be349a5e868db420bd.tar.gz
python/samba: changes needed for samba.tests.samba_tool.visualize PY2/PY3
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'python')
-rw-r--r--python/samba/kcc/kcc_utils.py2
-rw-r--r--python/samba/netcmd/visualize.py6
2 files changed, 4 insertions, 4 deletions
diff --git a/python/samba/kcc/kcc_utils.py b/python/samba/kcc/kcc_utils.py
index c099140c936..9959637836f 100644
--- a/python/samba/kcc/kcc_utils.py
+++ b/python/samba/kcc/kcc_utils.py
@@ -994,7 +994,7 @@ class NTDSConnection(object):
self.schedule = ndr_unpack(drsblobs.schedule, msg["schedule"][0])
if "whenCreated" in msg:
- self.whenCreated = ldb.string_to_time(msg["whenCreated"][0])
+ self.whenCreated = ldb.string_to_time(str(msg["whenCreated"][0]))
if "fromServer" in msg:
dsdn = dsdb_Dn(samdb, msg["fromServer"][0].decode('utf8'))
diff --git a/python/samba/netcmd/visualize.py b/python/samba/netcmd/visualize.py
index 93c0929326e..8292802326b 100644
--- a/python/samba/netcmd/visualize.py
+++ b/python/samba/netcmd/visualize.py
@@ -275,7 +275,7 @@ class cmd_reps(GraphCommand):
res = local_kcc.samdb.search(dsa_dn,
scope=SCOPE_BASE,
attrs=["dNSHostName"])
- dns_name = res[0]["dNSHostName"][0]
+ dns_name = str(res[0]["dNSHostName"][0])
print("Attempting to contact ldap://%s (%s)" %
(dns_name, dsa_dn),
file=sys.stderr)
@@ -508,7 +508,7 @@ class cmd_ntdsconn(GraphCommand):
for msg in res:
msgdn = str(msg.dn)
dest_dn = msgdn[msgdn.index(',') + 1:]
- attested_edges.append((msg['fromServer'][0],
+ attested_edges.append((str(msg['fromServer'][0]),
dest_dn, ntds_dn))
if importldif and H == self._tmp_fn_to_delete:
@@ -694,7 +694,7 @@ class cmd_uptodateness(GraphCommand):
expression=("(&(invocationId=%s)"
"(objectClass=nTDSDSA))" % inv_id),
attrs=["distinguishedName", "invocationId"])
- settings_dn = res[0]["distinguishedName"][0]
+ settings_dn = str(res[0]["distinguishedName"][0])
prefix, dsa_dn = settings_dn.split(',', 1)
if prefix != 'CN=NTDS Settings':
raise CommandError("Expected NTDS Settings DN, got %s" %