mysql_query, mysql_user: simple refactoring of type checks (#58)

* mysql_query: simple refactoring of query type check

* do the same for mysql_user

* Improve integration test coverage
This commit is contained in:
Andrew Klychkov 2020-11-06 13:12:07 +03:00 committed by GitHub
parent b2bde48020
commit 2dcbd7846f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 2 deletions

View file

@ -149,7 +149,7 @@ def main():
config_file = module.params['config_file']
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))
if isinstance(query, str):