Skip to content

Commit b45b599

Browse files
timorungegundalow
authored andcommitted
Fix for "AttributeError: 'module' object has no attribute 'cursors'" (ansible#49191) (ansible#53445)
* Fix for "AttributeError: 'module' object has no attribute 'cursors'" (ansible#49191) (#1) * Fix for "AttributeError: 'module' object has no attribute 'cursors'" (ansible#49191) * Adding changelog fragment for issue ansible#49191 and the following PR. * Update lib/ansible/module_utils/mysql.py Co-Authored-By: timorunge <timorunge@users.noreply.github.com>
1 parent 36baf7d commit b45b599

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
bugfixes:
2+
- mysql - MySQLdb doesn't import the cursors module for its own purposes so it has to be imported in MySQL module utilities before it can be used in dependent modules like the proxysql module family.

lib/ansible/module_utils/mysql.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
except ImportError:
3636
try:
3737
import MySQLdb as mysql_driver
38+
import MySQLdb.cursors
3839
_mysql_cursor_param = 'cursorclass'
3940
except ImportError:
4041
mysql_driver = None

0 commit comments

Comments
 (0)