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

Fixes error parser not recognizing % Invalid #931

Merged
merged 7 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from 5 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/error_parser_bug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
bugfixes:
- "Fix invalid password length not being recognized by the error parser."
1 change: 1 addition & 0 deletions plugins/terminal/ios.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class TerminalModule(TerminalBase):
re.compile(rb"% General session commands not allowed under the address family", re.I),
re.compile(rb"% BGP: Error initializing topology", re.I),
re.compile(rb"%SNMP agent not enabled", re.I),
re.compile(rb"% Invalid", re.I),
]

terminal_config_prompt = re.compile(r"^.+\(config(-.*)?\)#$")
Expand Down
15 changes: 15 additions & 0 deletions tests/integration/targets/ios_user/tests/cli/auth.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,21 @@
ansible.builtin.assert:
that:
- results.failed

- name: Test long password
cisco.ios.ios_user:
name: auth_user
privilege: 15
role: network-operator
state: present
configured_password: "{{ 'a' * 128 }}"
ignore_errors: true
roverflow marked this conversation as resolved.
Show resolved Hide resolved
register: result_fail

- name: Check that attempt failed
ansible.builtin.assert:
that:
- result_fail.failed
always:
- name: Reset connection with {{ ansible_user }}
ansible.builtin.meta: reset_connection
Expand Down