mirror of
https://github.com/samba-team/samba.git
synced 2025-02-03 13:47:25 +03:00
KCC: use python 2.6 compatible dictonary comprehensions
The `{k: v for k, v in whatever}` syntax is "new" in Python 2.7. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Fri Jun 12 09:46:13 CEST 2015 on sn-devel-104
This commit is contained in:
parent
bbe90840b9
commit
eef3dab079
@ -1285,7 +1285,7 @@ class KCC(object):
|
||||
"""
|
||||
rbhs_all = self.get_all_bridgeheads(rsite, part, transport,
|
||||
partial_ok, False)
|
||||
rbh_table = {x.dsa_dnstr: x for x in rbhs_all}
|
||||
rbh_table = dict((x.dsa_dnstr, x) for x in rbhs_all)
|
||||
|
||||
debug.DEBUG_GREY("rbhs_all: %s %s" % (len(rbhs_all),
|
||||
[x.dsa_dnstr for x in rbhs_all]))
|
||||
@ -2521,18 +2521,18 @@ class KCC(object):
|
||||
|
||||
if forget_local_links:
|
||||
for dsa in self.my_site.dsa_table.values():
|
||||
dsa.connect_table = {k: v for k, v in
|
||||
dsa.connect_table.items()
|
||||
if v.is_rodc_topology()}
|
||||
dsa.connect_table = dict((k, v) for k, v in
|
||||
dsa.connect_table.items()
|
||||
if v.is_rodc_topology())
|
||||
self.plot_all_connections('dsa_forgotten_local')
|
||||
|
||||
if forget_intersite_links:
|
||||
for site in self.site_table.values():
|
||||
for dsa in site.dsa_table.values():
|
||||
dsa.connect_table = {k: v for k, v in
|
||||
dsa.connect_table.items()
|
||||
if site is self.my_site and
|
||||
v.is_rodc_topology()}
|
||||
dsa.connect_table = dict((k, v) for k, v in
|
||||
dsa.connect_table.items()
|
||||
if site is self.my_site and
|
||||
v.is_rodc_topology())
|
||||
|
||||
self.plot_all_connections('dsa_forgotten_all')
|
||||
|
||||
|
@ -41,7 +41,7 @@ class NCType(object):
|
||||
(unknown, schema, domain, config, application) = range(0, 5)
|
||||
|
||||
# map the NCType enum to strings for debugging
|
||||
nctype_lut = {v: k for k, v in NCType.__dict__.items() if k[:2] != '__'}
|
||||
nctype_lut = dict((v, k) for k, v in NCType.__dict__.items() if k[:2] != '__')
|
||||
|
||||
|
||||
class NamingContext(object):
|
||||
|
Loading…
x
Reference in New Issue
Block a user