Skip to content

Commit

Permalink
Fix mysql.py logic related to 53326 (#61832)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andersson007 authored and gundalow committed Sep 6, 2019
1 parent 4f29b5a commit e4d4e49
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/ansible/module_utils/mysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def mysql_connect(module, login_user=None, login_password=None, config_file='',
except Exception as e:
module.fail_json(msg="unable to connect to database: %s" % to_native(e))

if cursor_class is not None:
if cursor_class == 'DictCursor':
return db_connection.cursor(**{_mysql_cursor_param: mysql_driver.cursors.DictCursor})
else:
return db_connection.cursor()
Expand Down
3 changes: 2 additions & 1 deletion lib/ansible/modules/database/mysql/mysql_replication.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,8 @@ def main():
login_user = module.params["login_user"]

try:
cursor = mysql_connect(module, login_user, login_password, config_file, ssl_cert, ssl_key, ssl_ca, None, 'mysql_driver.cursors.DictCursor',
cursor = mysql_connect(module, login_user, login_password, config_file,
ssl_cert, ssl_key, ssl_ca, None, cursor_class='DictCursor',
connect_timeout=connect_timeout)
except Exception as e:
if os.path.exists(config_file):
Expand Down

0 comments on commit e4d4e49

Please sign in to comment.