Fedora: handle ssh prompt with extra console chars #859
+1
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With fedora OS, the ssh login prompt has more extra brakceted console characters so make sure to include as wildcard
prompt:
^[]0;root@ltclp2:
^G^[[32mroot@ltcrain4-lp2^[[0m:^[[32m^[[0m#^[[0merror:
self.connect(logger)
File "/data/jenkins/workspace/sandbox/install/op-test/common/OpTestSSH.py", line 185, in connect
self.check_set_term()
File "/data/jenkins/workspace/sandbox/install/op-test/common/OpTestSSH.py", line 200, in check_set_term
self.util.setup_term(self.system, self.pty,
File "/", line 1709, in setup_term
raise ConsoleSettings(before=pty.before, after=pty.after,
common.Exceptions.ConsoleSettings: Setting the prompt or logging in for the console was not successful, check credentials and review the following for more details Expect Before Buffer="command-line line 0: Unsupported option "afstokenpassing"
Last login: Tue Aug 13 03:11:16 2024
root@ltcrain4-lp2:~#
Expect After Buffer="<class 'pexpect.exceptions.EOF'>" Message="Getting login and sudo not successful, probably connection issue, retry"