Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sanity errors #55

Merged
merged 1 commit into from
Oct 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelogs/fragments/55-linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
minor_changes:
- "command - the ``commands`` and ``wait_for`` options now convert the list elements to strings (https://github.com/ansible-collections/community.routeros/pull/55)."
- "facts - the ``gather_subset`` option now converts the list elements to strings (https://github.com/ansible-collections/community.routeros/pull/55)."
13 changes: 10 additions & 3 deletions plugins/modules/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,17 @@
module is not returned until the condition is satisfied or
the number of retries has expired.
required: true
type: list
elements: str
wait_for:
description:
- List of conditions to evaluate against the output of the
command. The task will wait for each condition to be true
before moving forward. If the conditional is not true
within the configured number of retries, the task fails.
See examples.
type: list
elements: str
match:
description:
- The I(match) argument is used in conjunction with the
Expand All @@ -44,20 +48,23 @@
satisfied.
default: all
choices: ['any', 'all']
type: str
retries:
description:
- Specifies the number of retries a command should by tried
before it is considered failed. The command is run on the
target device every retry and evaluated against the
I(wait_for) conditions.
default: 10
type: int
interval:
description:
- Configures the interval in seconds to wait between retries
of the command. If the command does not pass the specified
conditions, the interval indicates how long to wait before
trying the command again.
default: 1
type: int
seealso:
- ref: ansible_collections.community.routeros.docsite.ssh-guide
description: How to connect to RouterOS devices with SSH
Expand Down Expand Up @@ -131,10 +138,10 @@ def main():
"""main entry point for module execution
"""
argument_spec = dict(
commands=dict(type='list', required=True),
commands=dict(type='list', elements='str', required=True),

wait_for=dict(type='list'),
match=dict(default='all', choices=['all', 'any']),
wait_for=dict(type='list', elements='str'),
match=dict(type='str', default='all', choices=['all', 'any']),

retries=dict(default=10, type='int'),
interval=dict(default=1, type='int')
Expand Down
4 changes: 3 additions & 1 deletion plugins/modules/facts.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
not be collected.
required: false
default: '!config'
type: list
elements: str
seealso:
- ref: ansible_collections.community.routeros.docsite.ssh-guide
description: How to connect to RouterOS devices with SSH
Expand Down Expand Up @@ -586,7 +588,7 @@ def main():
"""main entry point for module execution
"""
argument_spec = dict(
gather_subset=dict(default=['!config'], type='list')
gather_subset=dict(default=['!config'], type='list', elements='str')
)

argument_spec.update(routeros_argument_spec)
Expand Down
5 changes: 0 additions & 5 deletions tests/sanity/ignore-2.10.txt

This file was deleted.

5 changes: 0 additions & 5 deletions tests/sanity/ignore-2.11.txt

This file was deleted.

5 changes: 0 additions & 5 deletions tests/sanity/ignore-2.12.txt

This file was deleted.

5 changes: 0 additions & 5 deletions tests/sanity/ignore-2.13.txt

This file was deleted.

3 changes: 0 additions & 3 deletions tests/sanity/ignore-2.9.txt

This file was deleted.