1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Use a list comprehension instead of map and lambda

This commit is contained in:
Toshio Kuratomi 2015-05-29 18:55:32 -07:00 committed by Matt Clay
parent 8976b46888
commit 0af631499a

View file

@ -320,7 +320,7 @@ def privileges_unpack(priv):
dbpriv = pieces[0].rsplit(".", 1)
pieces[0] = "`%s`.%s" % (dbpriv[0].strip('`'), dbpriv[1])
output[pieces[0]] = map(lambda s: s.strip(), pieces[1].upper().split(','))
output[pieces[0]] = [s.strip() for s in pieces[1].upper().split(',')]
new_privs = frozenset(output[pieces[0]])
if not new_privs.issubset(VALID_PRIVS):
raise InvalidPrivsError('Invalid privileges specified: %s' % new_privs.difference(VALID_PRIVS))