Changed code layout as suggested by flake8

This commit is contained in:
maximilian 2025-08-12 08:32:53 +02:00
commit 8fe42e74b6
2 changed files with 7 additions and 2 deletions

View file

@ -30,9 +30,11 @@ from ansible_collections.community.mysql.plugins.module_utils.implementations.my
class InvalidPrivsError(Exception):
pass
diff_current = {}
diff_new = {}
def get_mode(cursor):
cursor.execute('SELECT @@sql_mode')
result = cursor.fetchone()
@ -634,7 +636,9 @@ def user_mod(cursor, user, host, host_all, password, encrypted,
cursor.execute(*query_with_args)
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):
diff_new['state'] = "absent"

View file

@ -650,7 +650,8 @@ def main():
else:
changed = False
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__':