diff options
author | Andrew Klychkov <aaklychkov@mail.ru> | 2020-03-03 04:22:35 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-02 17:22:35 -0800 |
commit | 7f90fde5b3a1744c7fe5700dc4e754f6d109118c (patch) | |
tree | d2360972e4d26af69fbf93c69437b3a7fb3e1deb | |
parent | 7051a7ff92bcd586d89160a4da827891094882f3 (diff) | |
download | ansible-7f90fde5b3a1744c7fe5700dc4e754f6d109118c.tar.gz |
Bugfix of 65525: proxysql in check_config TypeError: tuple indices must be integers, not str (#66850) (#67334)
(cherry picked from commit a86524b2bb84a254f92a7351d95af8c3d83605a8)
-rw-r--r-- | lib/ansible/modules/database/proxysql/proxysql_backend_servers.py | 4 | ||||
-rw-r--r-- | lib/ansible/modules/database/proxysql/proxysql_global_variables.py | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/ansible/modules/database/proxysql/proxysql_backend_servers.py b/lib/ansible/modules/database/proxysql/proxysql_backend_servers.py index 675fa53608..59ef6444b3 100644 --- a/lib/ansible/modules/database/proxysql/proxysql_backend_servers.py +++ b/lib/ansible/modules/database/proxysql/proxysql_backend_servers.py @@ -259,6 +259,10 @@ class ProxySQLServer(object): cursor.execute(query_string, query_data) check_count = cursor.fetchone() + + if isinstance(check_count, tuple): + return int(check_count[0]) > 0 + return (int(check_count['host_count']) > 0) def get_server_config(self, cursor): diff --git a/lib/ansible/modules/database/proxysql/proxysql_global_variables.py b/lib/ansible/modules/database/proxysql/proxysql_global_variables.py index 604867b246..ac6c2cec35 100644 --- a/lib/ansible/modules/database/proxysql/proxysql_global_variables.py +++ b/lib/ansible/modules/database/proxysql/proxysql_global_variables.py @@ -119,6 +119,10 @@ def check_config(variable, value, cursor): cursor.execute(query_string, query_data) check_count = cursor.fetchone() + + if isinstance(check_count, tuple): + return int(check_count[0]) > 0 + return (int(check_count['variable_count']) > 0) |