diff options
author | Robin Miller <robin.miller@jamfsoftware.com> | 2015-05-26 12:36:46 -0500 |
---|---|---|
committer | Robin Miller <robin.miller@jamfsoftware.com> | 2015-05-26 12:56:08 -0500 |
commit | cda7a9be1592c82fd9c824185507d4ad3cbb5a5b (patch) | |
tree | 0488c822437bda6d8d29cf5244ee8ddb1b45524f | |
parent | 74b7ce9dcf93b1f37597ded6e6990d1e993a3b68 (diff) | |
download | ansible-modules-core-cda7a9be1592c82fd9c824185507d4ad3cbb5a5b.tar.gz |
Replaced lambda functions with list comprehensions.
-rw-r--r-- | database/mysql/mysql_user.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/database/mysql/mysql_user.py b/database/mysql/mysql_user.py index 824f2b47..afebd0a0 100644 --- a/database/mysql/mysql_user.py +++ b/database/mysql/mysql_user.py @@ -350,7 +350,7 @@ def privileges_revoke(cursor, user,host,db_table,priv,grant_option): query.append("FROM %s@%s") query = ' '.join(query) cursor.execute(query, (user, host)) - priv_string = ",".join(filter(lambda x: x not in [ 'GRANT', 'REQUIRESSL' ], priv)) + priv_string = ",".join([p for p in priv if p not in ('GRANT', 'REQUIRESSL')]) query = ["REVOKE %s ON %s" % (priv_string, mysql_quote_identifier(db_table, 'table'))] query.append("FROM %s@%s") query = ' '.join(query) @@ -360,7 +360,7 @@ def privileges_grant(cursor, user,host,db_table,priv): # Escape '%' since mysql db.execute uses a format string and the # specification of db and table often use a % (SQL wildcard) db_table = db_table.replace('%', '%%') - priv_string = ",".join(filter(lambda x: x not in [ 'GRANT', 'REQUIRESSL' ], priv)) + priv_string = ",".join([p for p in priv if p not in ('GRANT', 'REQUIRESSL')]) query = ["GRANT %s ON %s" % (priv_string, mysql_quote_identifier(db_table, 'table'))] query.append("TO %s@%s") if 'GRANT' in priv: |