mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-06-05 07:49:11 -07:00
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:
parent
b2bde48020
commit
2dcbd7846f
4 changed files with 24 additions and 2 deletions
|
@ -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):
|
||||
|
|
|
@ -1044,7 +1044,7 @@ def main():
|
|||
plugin_hash_string = module.params["plugin_hash_string"]
|
||||
plugin_auth_string = module.params["plugin_auth_string"]
|
||||
resource_limits = module.params["resource_limits"]
|
||||
if priv and not (isinstance(priv, str) or isinstance(priv, dict)):
|
||||
if priv and not isinstance(priv, (str, dict)):
|
||||
module.fail_json(msg="priv parameter must be str or dict but %s was passed" % type(priv))
|
||||
|
||||
if priv and isinstance(priv, dict):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue