Refactor to use connectors' info declared in setup_mysql

This commit is contained in:
Laurent Indermuehle 2022-08-15 09:32:00 +02:00
commit ef6a6c7573
No known key found for this signature in database
GPG key ID: 93FA944C9F34DD09
5 changed files with 6 additions and 12 deletions

View file

@ -343,7 +343,7 @@
that:
# PyMySQL driver throws a warning, so the following is correct
- result is not changed
when: connector.name.0 is search('pymysql')
when: connector_name is search('pymysql')
# Issue https://github.com/ansible-collections/community.mysql/issues/268
- assert:
@ -352,7 +352,7 @@
# if the state was changed or not.
# We assume that it was for DDL queryes by default in the code
- result is changed
when: connector.name.0 is search('mysqlclient')
when: connector_name is search('mysqlclient')
- name: Drop db {{ test_db }}
mysql_query:

View file

@ -9,8 +9,6 @@
block:
# ============================================================
- shell: pip show pymysql | awk '/Version/ {print $2}'
register: pymysql_version
- name: get server certificate
copy:

View file

@ -356,10 +356,6 @@
# plugins that are loaded by default are sha2*, but these aren't compatible with pymysql < 0.9, so skip these tests
# for those versions.
#
- name: Get pymysql version
shell: pip show pymysql | awk '/Version/ {print $2}'
register: pymysql_version
- name: Test plugin auth switching which doesn't work on pymysql < 0.9
when:
- >

View file

@ -51,12 +51,12 @@
- assert:
that:
- result is failed
when: connector.name.0 is search('pymysql')
when: connector_name is search('pymysql')
- assert:
that:
- result is succeeded
when: connector.name.0 is not search('pymysql')
when: connector_name is not search('pymysql')
- name: attempt connection with newly created user ignoring hostname
mysql_variables:

View file

@ -160,10 +160,10 @@
ignore_errors: true
- include: assert_var.yml changed=true output={{ oor_result }} var_name=max_connect_errors var_value=1
when: connector.name.0 is not search('pymysql')
when: connector_name is not search('pymysql')
- include: assert_fail_msg.yml output={{ oor_result }} msg='Truncated incorrect'
when: connector.name.0 is search('pymysql')
when: connector_name is search('pymysql')
# ============================================================
# Verify mysql_variable fails when setting an incorrect value (incorrect type)