Fix sanity issues

This commit is contained in:
Andrew Klychkov 2024-01-23 11:04:37 +01:00
parent 5ed3eaf3ee
commit 7fdbd38670
5 changed files with 7 additions and 10 deletions

View file

@ -577,14 +577,14 @@ def db_create(cursor, db, encoding, collation):
def main(): def main():
argument_spec = mysql_common_argument_spec() argument_spec = mysql_common_argument_spec()
argument_spec.update( argument_spec.update(
name=dict(type='list', required=True, aliases=['db']), name=dict(type='list', elements='str', required=True, aliases=['db']),
encoding=dict(type='str', default=''), encoding=dict(type='str', default=''),
collation=dict(type='str', default=''), collation=dict(type='str', default=''),
target=dict(type='path'), target=dict(type='path'),
state=dict(type='str', default='present', choices=['absent', 'dump', 'import', 'present']), state=dict(type='str', default='present', choices=['absent', 'dump', 'import', 'present']),
single_transaction=dict(type='bool', default=False), single_transaction=dict(type='bool', default=False),
quick=dict(type='bool', default=True), quick=dict(type='bool', default=True),
ignore_tables=dict(type='list', default=[]), ignore_tables=dict(type='list', elements='str', default=[]),
hex_blob=dict(default=False, type='bool'), hex_blob=dict(default=False, type='bool'),
force=dict(type='bool', default=False), force=dict(type='bool', default=False),
master_data=dict(type='int', default=0, choices=[0, 1, 2]), master_data=dict(type='int', default=0, choices=[0, 1, 2]),

View file

@ -698,8 +698,8 @@ def main():
argument_spec = mysql_common_argument_spec() argument_spec = mysql_common_argument_spec()
argument_spec.update( argument_spec.update(
login_db=dict(type='str'), login_db=dict(type='str'),
filter=dict(type='list'), filter=dict(type='list', elements='str'),
exclude_fields=dict(type='list'), exclude_fields=dict(type='list', elements='str'),
return_empty_dbs=dict(type='bool', default=False), return_empty_dbs=dict(type='bool', default=False),
) )

View file

@ -36,6 +36,7 @@ options:
- List of values to be passed as positional arguments to the query. - List of values to be passed as positional arguments to the query.
- Mutually exclusive with I(named_args). - Mutually exclusive with I(named_args).
type: list type: list
elements: raw
named_args: named_args:
description: description:
- Dictionary of key-value arguments to pass to the query. - Dictionary of key-value arguments to pass to the query.
@ -141,7 +142,7 @@ def main():
argument_spec.update( argument_spec.update(
query=dict(type='raw', required=True), query=dict(type='raw', required=True),
login_db=dict(type='str'), login_db=dict(type='str'),
positional_args=dict(type='list'), positional_args=dict(type='list', elements='raw'),
named_args=dict(type='dict'), named_args=dict(type='dict'),
single_transaction=dict(type='bool', default=False), single_transaction=dict(type='bool', default=False),
) )

View file

@ -176,7 +176,7 @@ def setvariable(cursor, mysqlvar, value, mode='global'):
def main(): def main():
argument_spec = mysql_common_argument_spec() argument_spec = mysql_common_argument_spec()
argument_spec.update( argument_spec.update(
variable=dict(type='str'), variable=dict(type='str', required=True),
value=dict(type='str'), value=dict(type='str'),
mode=dict(type='str', choices=['global', 'persist', 'persist_only'], default='global'), mode=dict(type='str', choices=['global', 'persist', 'persist_only'], default='global'),
) )

View file

@ -1,10 +1,6 @@
plugins/modules/mysql_db.py validate-modules:doc-elements-mismatch plugins/modules/mysql_db.py validate-modules:doc-elements-mismatch
plugins/modules/mysql_db.py validate-modules:parameter-list-no-elements
plugins/modules/mysql_db.py validate-modules:use-run-command-not-popen plugins/modules/mysql_db.py validate-modules:use-run-command-not-popen
plugins/modules/mysql_info.py validate-modules:doc-elements-mismatch plugins/modules/mysql_info.py validate-modules:doc-elements-mismatch
plugins/modules/mysql_info.py validate-modules:parameter-list-no-elements
plugins/modules/mysql_query.py validate-modules:parameter-list-no-elements
plugins/modules/mysql_user.py validate-modules:undocumented-parameter plugins/modules/mysql_user.py validate-modules:undocumented-parameter
plugins/modules/mysql_variables.py validate-modules:doc-required-mismatch
plugins/module_utils/mysql.py pylint:unused-import plugins/module_utils/mysql.py pylint:unused-import
plugins/module_utils/version.py pylint:unused-import plugins/module_utils/version.py pylint:unused-import