mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-07-23 05:10:24 -07:00
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>
This commit is contained in:
parent
3229ce4e55
commit
a5f3296d73
5 changed files with 106 additions and 3 deletions
|
@ -0,0 +1,32 @@
|
|||
---
|
||||
# Added in 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