From a2ee132e34a576812f29eaf27ea51dbc3f59d58c Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Wed, 20 Mar 2019 12:02:09 +1300 Subject: [PATCH 1/3] 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 0a0aecd6631..c8d5f9230d0 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.11.0 From c60cddae4e444608ba46ad7f40295a20f8fbbe25 Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Fri, 22 Mar 2019 15:24:47 +1300 Subject: [PATCH 2/3] 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 81d381abd99..ef4d706c8e2 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): @@ -2288,7 +2288,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.11.0 From f66d4f7d24e6c7f187f1388158e92c469b9408ae Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Wed, 20 Mar 2019 12:12:34 +1300 Subject: [PATCH 3/3] py/uptodateness: use 2.6 compatible dictionary construction Signed-off-by: Douglas Bagnall --- python/samba/uptodateness.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/samba/uptodateness.py b/python/samba/uptodateness.py index 3964bd7d6db..ced902bb3e4 100644 --- a/python/samba/uptodateness.py +++ b/python/samba/uptodateness.py @@ -194,6 +194,6 @@ def get_utdv_summary(distances, filters=None): } if filters: - return {key: summary[key] for key in filters} + return dict((key, summary[key]) for key in filters) else: return summary -- 2.11.0