Merge pull request #7590 from llamallama/develop

Fixing grant_option False being evaluated as a string and therefore True
This commit is contained in:
Pedro Algarvio 2013-10-04 00:23:43 -07:00
commit e1e8095d23

View File

@ -1010,7 +1010,7 @@ def __grant_generate(grant,
qry = 'GRANT {0} ON {1}.{2} TO {3!r}@{4!r}'.format(
grant, dbc, table, user, host
)
if grant_option:
if salt.utils.is_true(grant_option):
qry += ' WITH GRANT OPTION'
log.debug('Query generated: {0}'.format(qry))
return qry
@ -1161,7 +1161,7 @@ def grant_revoke(grant,
return False
cur = dbc.cursor()
if grant_option:
if salt.utils.is_true(grant_option):
grant += ', GRANT OPTION'
qry = 'REVOKE {0} ON {1} FROM {2!r}@{3!r};'.format(
grant, database, user, host