Skip to content

handle tlent_login if prompt is in config mode#35

Open
shreyashah wants to merge 1 commit intover_4.0.0from
try_show_tech_Ssh
Open

handle tlent_login if prompt is in config mode#35
shreyashah wants to merge 1 commit intover_4.0.0from
try_show_tech_Ssh

Conversation

@shreyashah
Copy link
Copy Markdown
Contributor

@shreyashah shreyashah commented Jun 3, 2024

1.	The telnet prompt of the router was left in config prompt. How it landed in config prompt is unknown because previous health check job had successfully disconnected console handle. After that, the testbed was assigned for a run 24 hours later. In between these 24 hours, someone logged intot he device and left it in config prompt.
2.	the telnet connection code when attempts to login to console, it is successful becaiuse it sees xr prompt but it assumes it is on exec prompt and not config prompt. it executes some cmds and makes some configurations which fail while committing because of commit conflict from previous session.

@shreyashah
Copy link
Copy Markdown
Contributor Author

Reports: allure.cisco.com/ws/shreyash-sjc/cafyinfra/cafykit/work/archive/test_console_20240603-095340_p3275248/reports/index.html

Reports: allure.cisco.com/ws/shreyash-sjc/cafyinfra/cafykit/work/archive/test_console_20240603-094733_p3273248/reports/index.html

@shreyashah shreyashah changed the title vvccccvlclnuijvfrlchtgfcjljdnduhrkrticdkbjrlhandle tlent_login if prompt is in config mode handle tlent_login if prompt is in config mode Jun 3, 2024
Comment on lines +181 to +189

if re.search('RP/\d+/RP\d+/CPU\d+:\S*\)#$', output):
# To check if it is in the config prompt
# If yes, then write newline char, "clear" and "end" to clear any stale configs
self.write_channel(self.TELNET_RETURN + "clear" + self.TELNET_RETURN)
self.read_channel()
self.write_channel("end" + self.TELNET_RETURN)
output = self.find_prompt()
return_msg += output
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is gonna be dangerous as we will always have this prompt and try to clear it.
If we cant verify this is 1st time login , then we dont want to add this code..

I would rather focus on yes/no being passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants