mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-04-08 11:40:33 -07:00
mysql_query: simple refactoring of query type check
This commit is contained in:
parent
c3dd146220
commit
ef8a4700b7
2 changed files with 3 additions and 1 deletions
2
changelogs/fragments/58-mysql_query_refactoring.yml
Normal file
2
changelogs/fragments/58-mysql_query_refactoring.yml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
minor_changes:
|
||||||
|
- mysql_query - simple refactoring of query type check (https://github.com/ansible-collections/community.mysql/pull/58).
|
|
@ -146,7 +146,7 @@ def main():
|
||||||
config_file = module.params['config_file']
|
config_file = module.params['config_file']
|
||||||
query = module.params["query"]
|
query = module.params["query"]
|
||||||
|
|
||||||
if not isinstance(query, str) and not isinstance(query, list):
|
if not isinstance(query, (str, list)):
|
||||||
module.fail_json(msg="the query option value must be a string or list, passed %s" % type(query))
|
module.fail_json(msg="the query option value must be a string or list, passed %s" % type(query))
|
||||||
|
|
||||||
if isinstance(query, str):
|
if isinstance(query, str):
|
||||||
|
|
Loading…
Add table
Reference in a new issue