pep8 fixes

This commit is contained in:
Michael DeHaan 2012-10-30 20:42:07 -04:00
parent 27e518a0b1
commit c0747b7baa
12 changed files with 60 additions and 56 deletions

View file

@ -176,7 +176,7 @@ def privileges_get(cursor, user,host):
privileges = res.group(1).split(", ")
privileges = ['ALL' if x=='ALL PRIVILEGES' else x for x in privileges]
if "WITH GRANT OPTION" in res.group(4):
privileges.append('GRANT')
privileges.append('GRANT')
db = res.group(2).replace('`', '')
output[db] = privileges
return output
@ -213,8 +213,7 @@ def privileges_grant(cursor, user,host,db_table,priv):
priv_string = ",".join(filter(lambda x: x != 'GRANT', priv))
query = "GRANT %s ON %s TO '%s'@'%s'" % (priv_string,db_table,user,host)
if 'GRANT' in priv:
query = query + " WITH GRANT OPTION"
query = query + " WITH GRANT OPTION"
cursor.execute(query)
def load_mycnf():