mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-07-23 05:10:24 -07:00
[PR #497/a5f3296d backport][stable-2] mysql_info - Add connector_name and connector_version to returned value (#499)
* mysql_info - Add connector_name and connector_version to returned value (#497)
* Add methods to retrieve connector name and version
* Document that mysqlclient is also named MySQLdb
* Document version_added
* Add connector name and version in the returned block
* Cut condition to display any name that is return
In case of MySQLdb is renamed in mysqlclient. In that case, the
integration tests will catch this the day we update the connector
version.
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
(cherry picked from commit a5f3296d73
)
* Cut fragment not relevant to the collection usage
* Update version_added for stable-2
---------
Co-authored-by: Laurent Indermühle <laurent.indermuehle@pm.me>
This commit is contained in:
parent
b16e57ddbc
commit
ff94dcdf0f
7 changed files with 106 additions and 11 deletions
|
@ -0,0 +1,32 @@
|
|||
---
|
||||
# Added in 1.5.0, 2.4.0 and 3.6.0 in
|
||||
# https://github.com/ansible-collections/community.mysql/pull/497
|
||||
|
||||
# TODO: Refactor in PR490.
|
||||
- name: Connector info | Assert connector_name exists and has expected values
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- result.connector_name is defined
|
||||
- result.connector_name is in ['pymysql', 'MySQLdb']
|
||||
success_msg: >-
|
||||
Assertions passed, result.connector_name is {{ result.connector_name }}
|
||||
fail_msg: >-
|
||||
Assertion failed, result.connector_name is
|
||||
{{ result.connector_name | d('Unknown')}} which is different than expected
|
||||
pymysql or MySQLdb
|
||||
|
||||
# TODO: Refactor in PR490.
|
||||
- name: Connector info | Assert connector_version exists and has expected values
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- result.connector_version is defined
|
||||
- >
|
||||
result.connector_version == 'Unknown'
|
||||
or result.connector_version is version(connector_ver, '==')
|
||||
success_msg: >-
|
||||
Assertions passed, result.connector_version is
|
||||
{{ result.connector_version }}
|
||||
fail_msg: >-
|
||||
Assertion failed, result.connector_version is
|
||||
{{ result.connector_version }} which is different than expected
|
||||
{{ connector_ver }}
|
|
@ -55,6 +55,10 @@
|
|||
- result.engines != {}
|
||||
- result.users != {}
|
||||
|
||||
- name: mysql_info - Test connector informations display
|
||||
ansible.builtin.import_tasks:
|
||||
file: connector_info.yml
|
||||
|
||||
# Access by non-default cred file
|
||||
- name: mysql_info - check non-default cred file
|
||||
mysql_info:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue