From eb01926b43d3a3d2e54a581ad143902b4f0689a7 Mon Sep 17 00:00:00 2001 From: Max Bubenick Date: Mon, 2 Mar 2020 18:54:52 -0300 Subject: [PATCH] Backport PR #67339 - Fix proxysql module cursor_class (#67471) * Fix merge conflicts * remove db_conn as mysql_utils was not backported from devel * fix indentation for sanity check --- changelogs/fragments/67337-fix-proxysql-mysql-cursor.yaml | 2 ++ .../modules/database/proxysql/proxysql_backend_servers.py | 2 +- .../modules/database/proxysql/proxysql_global_variables.py | 2 +- lib/ansible/modules/database/proxysql/proxysql_mysql_users.py | 2 +- lib/ansible/modules/database/proxysql/proxysql_query_rules.py | 2 +- .../database/proxysql/proxysql_replication_hostgroups.py | 2 +- lib/ansible/modules/database/proxysql/proxysql_scheduler.py | 2 +- 7 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 changelogs/fragments/67337-fix-proxysql-mysql-cursor.yaml diff --git a/changelogs/fragments/67337-fix-proxysql-mysql-cursor.yaml b/changelogs/fragments/67337-fix-proxysql-mysql-cursor.yaml new file mode 100644 index 00000000000..0bcb836e352 --- /dev/null +++ b/changelogs/fragments/67337-fix-proxysql-mysql-cursor.yaml @@ -0,0 +1,2 @@ +bugfixes: + - proxysql - fixed mysql dictcursor diff --git a/lib/ansible/modules/database/proxysql/proxysql_backend_servers.py b/lib/ansible/modules/database/proxysql/proxysql_backend_servers.py index 4595813c7d0..675fa536085 100644 --- a/lib/ansible/modules/database/proxysql/proxysql_backend_servers.py +++ b/lib/ansible/modules/database/proxysql/proxysql_backend_servers.py @@ -448,7 +448,7 @@ def main(): login_user, login_password, config_file, - cursor_class=mysql_driver.cursors.DictCursor) + cursor_class='DictCursor') except mysql_driver.Error as e: module.fail_json( msg="unable to connect to ProxySQL Admin Module.. %s" % to_native(e) diff --git a/lib/ansible/modules/database/proxysql/proxysql_global_variables.py b/lib/ansible/modules/database/proxysql/proxysql_global_variables.py index 92b02b62e0d..604867b2467 100644 --- a/lib/ansible/modules/database/proxysql/proxysql_global_variables.py +++ b/lib/ansible/modules/database/proxysql/proxysql_global_variables.py @@ -201,7 +201,7 @@ def main(): login_user, login_password, config_file, - cursor_class=mysql_driver.cursors.DictCursor) + cursor_class='DictCursor') except mysql_driver.Error as e: module.fail_json( msg="unable to connect to ProxySQL Admin Module.. %s" % to_native(e) diff --git a/lib/ansible/modules/database/proxysql/proxysql_mysql_users.py b/lib/ansible/modules/database/proxysql/proxysql_mysql_users.py index f15c724ec86..5607fde5cb0 100644 --- a/lib/ansible/modules/database/proxysql/proxysql_mysql_users.py +++ b/lib/ansible/modules/database/proxysql/proxysql_mysql_users.py @@ -420,7 +420,7 @@ def main(): login_user, login_password, config_file, - cursor_class=mysql_driver.cursors.DictCursor) + cursor_class='DictCursor') except mysql_driver.Error as e: module.fail_json( msg="unable to connect to ProxySQL Admin Module.. %s" % to_native(e) diff --git a/lib/ansible/modules/database/proxysql/proxysql_query_rules.py b/lib/ansible/modules/database/proxysql/proxysql_query_rules.py index b3482ae07f7..6ffc95fb565 100644 --- a/lib/ansible/modules/database/proxysql/proxysql_query_rules.py +++ b/lib/ansible/modules/database/proxysql/proxysql_query_rules.py @@ -547,7 +547,7 @@ def main(): login_user, login_password, config_file, - cursor_class=mysql_driver.cursors.DictCursor) + cursor_class='DictCursor') except mysql_driver.Error as e: module.fail_json( msg="unable to connect to ProxySQL Admin Module.. %s" % to_native(e) diff --git a/lib/ansible/modules/database/proxysql/proxysql_replication_hostgroups.py b/lib/ansible/modules/database/proxysql/proxysql_replication_hostgroups.py index 6cde01d9299..e01d0e1e69e 100644 --- a/lib/ansible/modules/database/proxysql/proxysql_replication_hostgroups.py +++ b/lib/ansible/modules/database/proxysql/proxysql_replication_hostgroups.py @@ -318,7 +318,7 @@ def main(): login_user, login_password, config_file, - cursor_class=mysql_driver.cursors.DictCursor) + cursor_class='DictCursor') except mysql_driver.Error as e: module.fail_json( msg="unable to connect to ProxySQL Admin Module.. %s" % to_native(e) diff --git a/lib/ansible/modules/database/proxysql/proxysql_scheduler.py b/lib/ansible/modules/database/proxysql/proxysql_scheduler.py index 1ce6287abb0..608b23f966a 100644 --- a/lib/ansible/modules/database/proxysql/proxysql_scheduler.py +++ b/lib/ansible/modules/database/proxysql/proxysql_scheduler.py @@ -358,7 +358,7 @@ def main(): login_user, login_password, config_file, - cursor_class=mysql_driver.cursors.DictCursor) + cursor_class='DictCursor') except mysql_driver.Error as e: module.fail_json( msg="unable to connect to ProxySQL Admin Module.. %s" % to_native(e)