Skip to content

Commit 9d5b035

Browse files
rsinner99Robin Sinner
andauthored
Update login re for junos Evo and fix byte encoding issue (#229)
Co-authored-by: Robin Sinner <robin.sinner@telekom.de>
1 parent 0487a4a commit 9d5b035

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Exscript/protocols/drivers/junos.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
# pheller@fw1>
4949
#
5050

51-
_user_re = [re.compile(r'[\r\n]login: $')]
51+
_user_re = [re.compile(r'[\r\n](?:[\-\w+]+ )?login: $')]
5252
_password_re = [re.compile(r'[\r\n](Local )?[Pp]assword: ?$')]
5353
_mb = r'(?:\{master(?::\d+)?\}|\{backup(?::\d+)?\})'
5454
_ps = r'(?:\{primary:node\d+\}|\{secondary:node\d+\})'

Exscript/protocols/telnetlib.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,10 @@ def process_rawq(self):
483483
# to perform, the indicated option.
484484
elif command == DO:
485485
opt = self.rawq_getchar()
486+
# int 0 produces an empty byte string which then has no ord
487+
# we can skip its processing
488+
if opt == b"":
489+
continue
486490
self.msg('IAC DO %s', ord(opt))
487491
if opt == TTYPE:
488492
self.sock.send(IAC+WILL+opt)

0 commit comments

Comments
 (0)