Skip to content
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

handle tlent_login if prompt is in config mode #35

Open
wants to merge 1 commit into
base: ver_4.0.0
Choose a base branch
from

Conversation

shreyashah
Copy link
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
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

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