diff options
author | Petr Viktorin <pviktori@redhat.com> | 2015-08-12 12:25:30 +0200 |
---|---|---|
committer | Jan Cholasta <jcholast@redhat.com> | 2015-09-01 11:42:01 +0200 |
commit | ace63f4ea55643cb99aaa444d216a6bb9ebb1ed3 (patch) | |
tree | 0b5367a1b43369dc0ea20b9e8fde91d44abed1f1 /ipalib/plugins/trust.py | |
parent | fbacc26a6a8b92f4b3570c411b186ab86cbcc1b1 (diff) | |
download | freeipa-ace63f4ea55643cb99aaa444d216a6bb9ebb1ed3.tar.gz freeipa-ace63f4ea55643cb99aaa444d216a6bb9ebb1ed3.tar.xz freeipa-ace63f4ea55643cb99aaa444d216a6bb9ebb1ed3.zip |
Replace uses of map()
In Python 2, map() returns a list; in Python 3 it returns an iterator.
Replace all uses by list comprehensions, generators, or for loops,
as required.
Reviewed-By: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Diffstat (limited to 'ipalib/plugins/trust.py')
-rw-r--r-- | ipalib/plugins/trust.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ipalib/plugins/trust.py b/ipalib/plugins/trust.py index 6400a4c54..febe16f1d 100644 --- a/ipalib/plugins/trust.py +++ b/ipalib/plugins/trust.py @@ -534,7 +534,7 @@ class trust(LDAPObject): error=_("invalid SID: %(value)s") % dict(value=value)) def get_dn(self, *keys, **kwargs): - sdn = map(lambda x: ('cn', x), keys) + sdn = [('cn', x) for x in keys] sdn.reverse() trust_type = kwargs.get('trust_type') if trust_type is None: @@ -1233,7 +1233,7 @@ class trust_resolve(Command): if not _nss_idmap_installed: return dict(result=result) try: - sids = map(lambda x: str(x), options['sids']) + sids = [str(x) for x in options['sids']] xlate = pysss_nss_idmap.getnamebysid(sids) for sid in xlate: entry = dict() @@ -1402,7 +1402,7 @@ class trustdomain(LDAPObject): # to the parent object's get_dn() no matter what you pass to it. Make own get_dn() # as we really need all elements to construct proper dn. def get_dn(self, *keys, **kwargs): - sdn = map(lambda x: ('cn', x), keys) + sdn = [('cn', x) for x in keys] sdn.reverse() trust_type = kwargs.get('trust_type') if not trust_type: |