iox_xr driver modification needed
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