From: Noel Power Date: Tue, 19 Jun 2018 10:22:50 +0000 (+0100) Subject: python/samba/kcc: md5 needs to be passed bytes in py3 X-Git-Tag: ldb-1.5.0~282 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d96d85a22be6da5b627ea6de212e99b8d08dca94;p=thirdparty%2Fsamba.git python/samba/kcc: md5 needs to be passed bytes in py3 Signed-off-by: Noel Power Reviewed-by: Andreas Schneider Signed-off-by: Joe Guo Reviewed-by: Douglas Bagnall --- diff --git a/python/samba/kcc/__init__.py b/python/samba/kcc/__init__.py index 1b22bf73a9f..eace6612497 100644 --- a/python/samba/kcc/__init__.py +++ b/python/samba/kcc/__init__.py @@ -44,6 +44,7 @@ from samba.kcc.graph import Vertex from samba.kcc.debug import DEBUG, DEBUG_FN, logger from samba.kcc import debug +from samba.compat import text_type def sort_dsa_by_gc_and_guid(dsa1, dsa2): @@ -2586,7 +2587,8 @@ class KCC(object): dot_colours = [] for link in self.sitelink_table.values(): from hashlib import md5 - colour = '#' + md5(link.dnstr).hexdigest()[:6] + tmp_str = link.dnstr.encode('utf8') + colour = '#' + md5(tmp_str).hexdigest()[:6] for a, b in itertools.combinations(link.site_list, 2): dot_edges.append((a[1], b[1])) dot_colours.append(colour)