From c2434e522035d27127ffb4a54fdfe80b2d0d0bd4 Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Wed, 20 Mar 2019 12:02:09 +1300 Subject: [PATCH 1/2] py/graph: use 2.6 compatible check for set membership It is better this way anyway. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13837 Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Wed Mar 20 06:36:05 UTC 2019 on sn-devel-144 (cherry picked from commit c0aca17a4c9ec06f0127d5c972f3fa979a87a77f) --- python/samba/graph.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/samba/graph.py b/python/samba/graph.py index e80a8820667..25673ac6770 100644 --- a/python/samba/graph.py +++ b/python/samba/graph.py @@ -88,7 +88,7 @@ def shorten_vertex_names(vertices, suffix=',...', aggressive=False): try: while True: c = set(x[i] for x in vlist) - if len(c) > 1 or c == {'*'}: + if len(c) > 1 or '*' in c: break i -= 1 except IndexError: -- 2.17.1 From e3a4c55d4fa547d4ed36377ed187b0d6db666287 Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Fri, 22 Mar 2019 15:24:47 +1300 Subject: [PATCH 2/2] py/kcc_utils: py2.6 compatibility BUG: https://bugzilla.samba.org/show_bug.cgi?id=13837 Signed-off-by: Douglas Bagnall --- python/samba/kcc/kcc_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/samba/kcc/kcc_utils.py b/python/samba/kcc/kcc_utils.py index 1457ea355e0..0fbf55939ae 100644 --- a/python/samba/kcc/kcc_utils.py +++ b/python/samba/kcc/kcc_utils.py @@ -31,7 +31,7 @@ from samba.dcerpc import ( ) from samba.common import dsdb_Dn from samba.ndr import ndr_unpack, ndr_pack -from collections import Counter +from collections import defaultdict class KCCError(Exception): @@ -2287,7 +2287,7 @@ def uncovered_sites_to_cover(samdb, site_name): scope=ldb.SCOPE_SUBTREE, expression="(objectClass=site)") - sites_in_use = Counter() + sites_in_use = defaultdict(int) dc_count = 0 # Assume server is of form DC,Servers,Site-ABCD because of schema -- 2.17.1