carlmontanari / scrapli

Fast, flexible, sync/async, Python 3.7+ screen scraping client specifically for network devices
https://carlmontanari.github.io/scrapli/
MIT License
575 stars 59 forks source link

Add maintenance mode in cisco_nxos prompt patterns #324

Closed mota-ovhcloud closed 5 months ago

mota-ovhcloud commented 5 months ago

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:

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

Type of change

How Has This Been Tested?

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

This hasn't unfortunately been tested on unprivileged mode.

carlmontanari commented 5 months ago

👋 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 commented 5 months ago

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

carlmontanari commented 5 months ago

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 !

mota-ovhcloud commented 5 months ago

Thanks a lot Carl, for the whole work !