]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
python/samba/kcc: md5 needs to be passed bytes in py3
authorNoel Power <noel.power@suse.com>
Tue, 19 Jun 2018 10:22:50 +0000 (11:22 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 12 Jul 2018 23:12:25 +0000 (01:12 +0200)
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
python/samba/kcc/__init__.py

index 1b22bf73a9f51e3844c47a2f4e488acf0bf3cc9b..eace6612497efe260dca9c48fe5e097e65c2b1c2 100644 (file)
@@ -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)