mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-08-15 10:31:44 -07:00
Changed code layout as suggested by flake8
This commit is contained in:
parent
b895692181
commit
8fe42e74b6
2 changed files with 7 additions and 2 deletions
|
@ -30,9 +30,11 @@ from ansible_collections.community.mysql.plugins.module_utils.implementations.my
|
||||||
class InvalidPrivsError(Exception):
|
class InvalidPrivsError(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
diff_current = {}
|
diff_current = {}
|
||||||
diff_new = {}
|
diff_new = {}
|
||||||
|
|
||||||
|
|
||||||
def get_mode(cursor):
|
def get_mode(cursor):
|
||||||
cursor.execute('SELECT @@sql_mode')
|
cursor.execute('SELECT @@sql_mode')
|
||||||
result = cursor.fetchone()
|
result = cursor.fetchone()
|
||||||
|
@ -634,7 +636,9 @@ def user_mod(cursor, user, host, host_all, password, encrypted,
|
||||||
cursor.execute(*query_with_args)
|
cursor.execute(*query_with_args)
|
||||||
changed = True
|
changed = True
|
||||||
|
|
||||||
return {'changed': changed, 'msg': msg, 'password_changed': password_changed, 'attributes': final_attributes, 'diff_current': diff_current, 'diff_new': diff_new}
|
return {'changed': changed, 'msg': msg, 'password_changed': password_changed, 'attributes': final_attributes,
|
||||||
|
'diff_current': diff_current, 'diff_new': diff_new}
|
||||||
|
|
||||||
|
|
||||||
def user_delete(cursor, user, host, host_all, check_mode):
|
def user_delete(cursor, user, host, host_all, check_mode):
|
||||||
diff_new['state'] = "absent"
|
diff_new['state'] = "absent"
|
||||||
|
|
|
@ -650,7 +650,8 @@ def main():
|
||||||
else:
|
else:
|
||||||
changed = False
|
changed = False
|
||||||
msg = "User doesn't exist"
|
msg = "User doesn't exist"
|
||||||
module.exit_json(changed=changed, diff={'before': diff_current, 'after': diff_new}, user=user, msg=msg, password_changed=password_changed, attributes=final_attributes)
|
module.exit_json(changed=changed, diff={'before': diff_current, 'after': diff_new}, user=user, msg=msg,
|
||||||
|
password_changed=password_changed, attributes=final_attributes)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue