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

Add maintenance mode in cisco_nxos prompt patterns #324

Merged
merged 5 commits into from
Apr 25, 2024

Conversation

mota-ovhcloud
Copy link
Contributor

Handling maintenance mode (maint-mode) in prompts on Cisco NX-OS.

Description

When maintenance mode is activated on Cisco NX-OS (with config command "system mode maintenance"), device's prompt is modified as below:

  • Privileged: hostname(maint-mode)#
  • Config: hostname(maint-mode)(config)#
  • Tclsh privlieged: hostname(maint-mode-tcl)#
  • Tclsh config: hostname(maint-mode)(config-tcl)#

This PR proposes the modification of related cisco_nxos base_driver.py patterns.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Tested with real device by modifying the following properties of scrapli object:

  • connection.comms_prompt_pattern
  • connection.privilege_levels.values.pattern of 'privilege_exec' and 'configuration'

This hasn't unfortunately been tested on unprivileged mode.

Handling maintenance mode (maint-mode) in prompts on Cisco NX-OS.
@carlmontanari
Copy link
Owner

👋 hey @mota-ovhcloud -- seems pretty reasonable to me! would you be able to add some tests here and take a look at why pytest is upset about the escapes?

Thanks for raising this!

@mota-ovhcloud
Copy link
Contributor Author

Hey @carlmontanari, thanks for your reply !
OK, will definitely add the required tests. I found the typo (\m) that causes pytest to be upset, line 51 :)
Mota

mota-ovhcloud and others added 4 commits April 25, 2024 14:38
erroneous backslash before m.
Reordering and removing duplicate
priv_pattern ("configuration", "switch(config)# ")
@carlmontanari
Copy link
Owner

welp... ssh2 continues to be a pita in ci and in general hah. but that is not related to this so will go ahead and get this merged and fix that... later :) thanks for the work @mota-ovhcloud !

@carlmontanari carlmontanari merged commit f0d0812 into carlmontanari:main Apr 25, 2024
7 of 12 checks passed
@mota-ovhcloud
Copy link
Contributor Author

Thanks a lot Carl, for the whole work !

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.

2 participants