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

Ansible ios_command prompt issue #1063

Open
andresgiuffre opened this issue Apr 25, 2024 · 0 comments
Open

Ansible ios_command prompt issue #1063

andresgiuffre opened this issue Apr 25, 2024 · 0 comments
Assignees

Comments

@andresgiuffre
Copy link

SUMMARY

I'm sending a command to copy a file from a FTP server. The prompt will ask to confirm the file name, so I'm sending '\r' as the answer, as a carriage return. Everything works fine with many devices, but then a new file comes into play, and the file has a name similar to this: cModelx-universalk9.version.bin

So, I'm receiving the following error in the console:

Failed to compile one or more terminal prompt regexes: bad character range x-u at position 7

What's happening here is that the prompt is reading the filename string as if I were using regex, so it's treating that part of the name where you have the x-u as if I'm trying to tell "Hey! check for characters among the x and u letters!" ... of course, it won't work since x comes after the u letter. It's not failing with other file names. I have a file that has a-x in the string, and it's not failing.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

ios_command

ANSIBLE VERSION
Ansible Automation Platform Controller v4.5.0
COLLECTION VERSION

CONFIGURATION

OS / ENVIRONMENT
STEPS TO REPRODUCE

Device is a Catalyst 2960x. The task works with other files, it's just this particular file in which you have that x-u as a part of the name.

- name: FTP Transfer
     ios_command:
       commands:
         - command: 'copy ftp://server/path/{{ filename }}'
            prompt: '[ {{ filename }} ]'
            answer: "\r"

"filename" is the variable containing a string with the name of the file.

EXPECTED RESULTS

The expected result is that the FTP transfer takes place smoothly

ACTUAL RESULTS

I just receive the following error:

Failed to compile one or more terminal prompt regexes: bad character range x-u at position 7

TASK [FTP Transfer] ****************************************

fatal: [DeviceName]: FAILED! => {"changed": false, "msg": "Failed to compile one or more terminal prompt regexes: bad character range x-u at position 7.\nPrompts provided: [b'[ cModelx-universalk9.version.bin ]']"}

Thursday 25 April 2024 18:55:17 +0000 (0:00:01.342) 0:02:03.969 ********
@roverflow roverflow self-assigned this May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants