-
Notifications
You must be signed in to change notification settings - Fork 344
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
Fix for issue #995 #1147
Fix for issue #995 #1147
Conversation
lib/jnpr/junos/utils/start_shell.py
Outdated
) | ||
else: | ||
self._client = open_ssh_client(dev=self._nc) | ||
self._chan = self._client.invoke_shell() | ||
|
||
got = self.wait_for(r"(%|>|#|\$)") | ||
if got[-1].endswith(_JUNOS_PROMPT): | ||
self.send("start shell") | ||
self.send("start shell self.shell_type") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to concatenate two strings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review comments ,
Fixed the command
self.send("start shell " + self.shell_type)
lib/jnpr/junos/utils/start_shell.py
Outdated
shell=False, | ||
stdin=subprocess.PIPE, | ||
stdout=subprocess.PIPE, | ||
close_fds=1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where did you create fd and bufsize?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed the close_fds and bufsize
self._chan = subprocess.Popen(
["cli", "start", "shell", self.shell_type],
shell=False,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
)
@@ -100,18 +112,20 @@ def open(self): | |||
""" | |||
if self.ON_JUNOS is True: | |||
self._chan = subprocess.Popen( | |||
["cli", "start", "shell"], | |||
["cli", "start", "shell", self.shell_type], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the behaviour if start shell is None
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shell_type="csh" is initialized with csh by default in init of StartShell,
Please update UT. |
Closing this pull request and submitting new one . |
Fix for issue jnpr.junos.utils.start_shell option to choose shell (sh or csh) #995
with this fix StartShell supports the argument shell_type for on-box , we can pass csh or sh shell types