Skip to content

Commit

Permalink
Update login re for junos Evo and fix byte encoding issue (#229)
Browse files Browse the repository at this point in the history
Co-authored-by: Robin Sinner <robin.sinner@telekom.de>
  • Loading branch information
rsinner99 and Robin Sinner authored Aug 24, 2023
1 parent 0487a4a commit 9d5b035
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Exscript/protocols/drivers/junos.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
# pheller@fw1>
#

_user_re = [re.compile(r'[\r\n]login: $')]
_user_re = [re.compile(r'[\r\n](?:[\-\w+]+ )?login: $')]
_password_re = [re.compile(r'[\r\n](Local )?[Pp]assword: ?$')]
_mb = r'(?:\{master(?::\d+)?\}|\{backup(?::\d+)?\})'
_ps = r'(?:\{primary:node\d+\}|\{secondary:node\d+\})'
Expand Down
4 changes: 4 additions & 0 deletions Exscript/protocols/telnetlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,10 @@ def process_rawq(self):
# to perform, the indicated option.
elif command == DO:
opt = self.rawq_getchar()
# int 0 produces an empty byte string which then has no ord
# we can skip its processing
if opt == b"":
continue
self.msg('IAC DO %s', ord(opt))
if opt == TTYPE:
self.sock.send(IAC+WILL+opt)
Expand Down

0 comments on commit 9d5b035

Please sign in to comment.