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 subprompts 'None' stringification in call to send_command #36254
Conversation
send_command already performs the to_bytes safely on prompts (checking for None). Without this check the literal 'None' became a subprompt trigger!
Debug of the error (with extra local debug turned on):
|
Note: I don't see other places where the caller uses to_bytes on the prompts, but there are a couple of occurrences of to_bytes on the command being sent. (Also redundant with what send_command already covers).
|
That's what I get for forgetting how I've fixed it elsewhere. This is of course preferred, pushing the translation to the last point in common code. |
send_command already performs the to_bytes safely on prompts (checking for None). Without this check the literal 'None' became a subprompt trigger! Fixes ansible#35662 (cherry picked from commit f2818ca)
send_command already performs the to_bytes safely on prompts (checking for None). Without this check the literal 'None' became a subprompt trigger!
SUMMARY
The call to
send_command
in iosedit_config
was interningprompts=None
to the literal string'None'
causing any output from the device to be scanned for a subprompt None and sending 'None' back as the answer was also'None'
.Since send_command already does a safer
to_bytes()
on these parameters, I removed the unneccessary calls incliconf/ios.py
ISSUE TYPE
COMPONENT NAME
cliconf/ios.py
network_cli
ANSIBLE VERSION
ADDITIONAL INFORMATION
Example play that triggered this bug: