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

Support detecting failures for other device types #335

Closed etiedem closed 3 months ago

etiedem commented 3 months ago

Describe the bug Not detecting a failed result

To Reproduce Steps to reproduce the behavior:

  1. I have to run scripts on unknown device types and so if I run the command "show config running" the XR driver doesn't detect the failed output if the device is actually an NX device
  2. (vendor, platform, version) Cisco, N7710, 8.4(5)
  3. Appending "% Invalid command at" to scrapli.driver.core.cisco_iosxr.base_driver.FAILED_WHEN_CONTAINS resolves issue

Expected behavior The response received from send_command to be True

OS (please complete the following information):

carlmontanari commented 3 months ago

the XR driver doesn't detect the failed output if the device is actually an NX device

yeah, thats kinda the point, they are platform specific on purpose.

you can use a generic driver and extend it in any way you wish to support connecting to whatever you want however you want. or you can just use the XR driver I guess if you want and extend that however you want. -- by extend I mean change any of the settings, in this case change the failed when contains list, but could be whatever (prompt patterns, priv levels, whatever). in any case, definitely not something that scrapli is going to change, especially since this is already configurable.