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

iox_xr driver modification needed #228

Open
fpuleio opened this issue Jul 25, 2023 · 0 comments
Open

iox_xr driver modification needed #228

fpuleio opened this issue Jul 25, 2023 · 0 comments

Comments

@fpuleio
Copy link

fpuleio commented Jul 25, 2023

I am trying to connect to a cisco ios xr device.

ios_xr: Attempting to authenticate ***.
ios_xr: Attempting to app-authenticate **.
ios_xr: waiting for: ['[\r\n][^\\r\\n]
(?:bad secrets|denied|invalid|too short|incorrect|connection timed out|failed|failure)', '[\r\n]*Username: $', '(?:s\/key|otp-md4) (\d+) (\S+)(?=\s|[\r\n])', '[\r\n]Password: $', '[\r\n\x00]RP/\d+/(?:RS?P)?\d+\/CPU\d+:[^#]+(?:\([^\\)]+\))?#$']
Telnet(10.103.123.110,23): Expecting ['[\r\n][^\\r\\n]
(?:bad secrets|denied|invalid|too short|incorrect|connection timed out|failed|failure)', '[\r\n]Username: $', '(?:s\/key|otp-md4) (\d+) (\S+)(?=\s|[\r\n])', '[\r\n]Password: $', '[\r\n\x00]RP/\d+/(?:RS?P)?\d+\/CPU\d+:[^#]+(?:\([^\\)]+\))?#$']
...
Telnet(x.y.w.z,23): recv b'Username: '
ios_xr: Got a prompt, match was 'Username: '
ios_xr: Response was 'U'
ios_xr: Username prompt 1 received.
Telnet(x.y.w.z,23): Expecting ['[\r\n]Username: $']
ios_xr: Got a prompt, match was 'Username: '
ios_xr: Response was 'U'
ios_xr: Sending '
\r'

i am not getting any \r or \n in the prompt.
i thus went into the ios_xr driver and modified from

_user_re = [re.compile(r'[\r\n]Username: $')]
_password_re = [re.compile(r'[\r\n]Password: $')]

to

_user_re = [re.compile(r'[\r\n]*Username: $')]
_password_re = [re.compile(r'[\r\n]*Password: $')]

(added 0 or more match for the [\r\n])

this makes my telent connection go through

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

1 participant