Skip to content

Commit

Permalink
Merge pull request #1187 from chidanandpujar/start_shell_onbox_shell_…
Browse files Browse the repository at this point in the history
…type_fix1

fix for issue #1186
  • Loading branch information
dineshbaburam91 authored Jul 13, 2022
2 parents ac3d41c + b8553f9 commit a63d040
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/jnpr/junos/utils/start_shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ def __init__(self, nc, timeout=30, shell_type="csh"):
self.shell_type = shell_type

def write_stdin(self, stdin, data):
while True:
stdin.write(six.b(data))
stdin.flush()
stdin.write(data.encode("utf-8"))
stdin.flush()

def wait_for(self, this=_SHELL_PROMPT, timeout=0, sleep=0):
"""
Expand Down Expand Up @@ -95,7 +94,7 @@ def send(self, data):
"""
if self.ON_JUNOS is True:
data += " && echo ']]>]]>' \n"
self._chan.stdin.write(data)
self._chan.stdin.write(data.encode("utf-8"))
self.t = Thread(target=self.write_stdin, args=(self._chan.stdin, data))
self.t.daemon = True # thread dies with the program
self.t.start()
Expand Down

0 comments on commit a63d040

Please sign in to comment.