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 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/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
11 changes: 11 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,17 @@
ansible.builtin.assert:
that:
- results.failed

- name: Test long password fails
cisco.ios.ios_user:
name: auth_user
privilege: 15
role: network-operator
state: present
configured_password: "{{ 'a' * 128 }}"
register: result_fail
failed_when: "'Invalid Password length' not in result_fail.msg"

always:
- name: Reset connection with {{ ansible_user }}
ansible.builtin.meta: reset_connection
Expand Down
Loading