summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2023-03-10 09:08:48 +0100
committerJule Anger <janger@samba.org>2023-04-05 11:41:32 +0000
commit4022ee96aef8184f7d1a4686e06113cda7e29ac3 (patch)
tree742d023e45d7af6c9d0cd2c777550e7b2409b1dd
parent50f68094f68078072510d9193e72eef56c70c6d5 (diff)
downloadsamba-4022ee96aef8184f7d1a4686e06113cda7e29ac3.tar.gz
python:netcmd: Decode return value of find_netbios() from bytes into string
ERROR(<class 'TypeError'>): uncaught exception - replace() argument 1 must be str, not bytes File "bin/python/samba/netcmd/__init__.py", line 230, in _run return self.run(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "bin/python/samba/netcmd/ldapcmp.py", line 966, in run if b1.diff(b2): ^^^^^^^^^^^ File "bin/python/samba/netcmd/ldapcmp.py", line 790, in diff if object1 == object2: ^^^^^^^^^^^^^^^^^^ File "bin/python/samba/netcmd/ldapcmp.py", line 557, in __eq__ return self.cmp_attrs(other) ^^^^^^^^^^^^^^^^^^^^^ File "bin/python/samba/netcmd/ldapcmp.py", line 656, in cmp_attrs p = [self.fix_domain_netbios(j) for j in m] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "bin/python/samba/netcmd/ldapcmp.py", line 656, in <listcomp> p = [self.fix_domain_netbios(j) for j in m] ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "bin/python/samba/netcmd/ldapcmp.py", line 542, in fix_domain_netbios res = res.replace(self.con.domain_netbios.lower(), self.con.domain_netbios.upper()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ BUGS: https://bugzilla.samba.org/show_bug.cgi?id=15330 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit 4fa0242b9d34decd8dbd813be40655a593df3db9) Autobuild-User(v4-18-test): Jule Anger <janger@samba.org> Autobuild-Date(v4-18-test): Wed Apr 5 11:41:32 UTC 2023 on atb-devel-224
-rw-r--r--python/samba/netcmd/ldapcmp.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/python/samba/netcmd/ldapcmp.py b/python/samba/netcmd/ldapcmp.py
index fb49cbe1ae5..ff26e96332d 100644
--- a/python/samba/netcmd/ldapcmp.py
+++ b/python/samba/netcmd/ldapcmp.py
@@ -121,7 +121,7 @@ class LDAPBase(object):
for x in res:
if "nETBIOSName" in x:
- return x["nETBIOSName"][0]
+ return x["nETBIOSName"][0].decode()
def object_exists(self, object_dn):
res = None