Scrapli

Latest version: v2024.1.30

Safety actively analyzes 638773 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 13

2022.01.30.post1

A quick post-release to include a minor tweak to the "in-channel" password prompt pattern. The pattern in 2022.01.30 broke due to a really really lame default login banner on devices in CML/VIRL/whatever its called today. Users could always change this (or change the lame banner!) but probably many folks wouldn't know where to look so just updating the pattern seems like a simpler solution!

What's Changed
* Feature textfsm template file by haccht in https://github.com/carlmontanari/scrapli/pull/215
* Housekeeping by carlmontanari in https://github.com/carlmontanari/scrapli/pull/217
* prep post release 2022.01.30.post1 by carlmontanari in https://github.com/carlmontanari/scrapli/pull/219

New Contributors
* haccht made their first contribution in https://github.com/carlmontanari/scrapli/pull/215

**Full Changelog**: https://github.com/carlmontanari/scrapli/compare/2022.01.30...2022.01.30.post1

2022.01.30

What's Changed
* Develop by carlmontanari in https://github.com/carlmontanari/scrapli/pull/85
* Merge develop early to fix weekly build by carlmontanari in https://github.com/carlmontanari/scrapli/pull/96

2022.01.30a2

Fixes broken channel log in a1 release.

2022.01.30a1

Pre release to unblock scrapli-netconf/cfg updates

- Removed deprecated `comms_ansi` argument
- Improved error handling/error message for insufficient permissions when opening ssh config/known hosts file
(system transport)
- Added support for hashed entries in known hosts file thanks to kangtastic work in 174
- Improved "in channel" SSH and Telnet authentication handling; better consistency between sync and async, patterns
are now compiled only if/when needed
- Added option to *enable* echo in PTYProcess (was originally removed from vendor'd code) -- should only be
useful/necessary with netconf 165
- Allow users to build their own `open_cmd` for system transport -- users can override this to do things like
`kubectl exec -it args args args` or `docker exec -it args args args` to connect to containers in k8s/docker 166
- Updated/fixed(?) Juniper shell patterns for "normal" and root shells 170
- Support transport options being passed to asyncssh transport thanks to cuong-nguyenduy work in 178 and 183

2021.07.30

- Added "% Unavailable command" to EOS `failed_when_contains`
- Moved core platform `failed_when_contains` to base to not have to duplicate them in sync and async platforms
- Add `file_mode` to the `enable_basic_logging` function, can now choose "append" or "write" for logfile
- Add `channel_log_mode` to the base driver arguments; you can now choose "append" or "write" for this as well!
- Improve reading until prompt methods; no longer use re.search on the entire received byte string, now only checks for prompt on the last N chars where N is governed by the base channel args `comms_prompt_search_depth` attribute... this fixes an issue where scrapli could be wayyyyyy slow for very very large outputs (like full tables show bgp)
- Fix bug (or just terrible initial idea!?) in asynctelnet that reset a timer back to a very small value that was used for testing; *most* people shouldn't have noticed an issue here, but if you had slow devices this could cause issues that "looked" like an authentication issue due to scrapli not having responded to all telnet control characters before punting to auth
- Added `commandeer` to driver object; this is used to "commandeer" an existing connection but treat it like the new connection object (prompt patterns, methods, etc.) -- generally this would be used for using `GenericDriver` to connect to a console server, then "commandeering" that connection and turning it into an IOSXR/IOSXE/etc. connection object so you have all the "normal" behavior of scrapli
- Add missing timeout on the asynctelnet open method
- Add py.typed to hopefully do typing more correctly :P
- BUGFIX: network drivers aborted configuration sessions if responses were failed even if the `stop_on_failed` arg was set to False; this has been fixed now so that sessions are only aborted if the response is failed *and*
- Improved typing for `send_interactive`
- Remove napalm dev requirement -- switch to scrapli-cfg for dev environment config management; something something eating dog food or whatever.
- Deprecate `comms_ansi` -- if there is an ANSI escape sequence we will now just strip it out automagically; this is *not* currently a breaking change, but will be -- there is a deprecation warning now and `comms_ansi` will be fully removed in the 2022.01.30 release (and pre-releases).
- Removed a sleep that was in the default `on_open` for IOSXR devices... this has been there a while and I *think* it was just a hold over from early early versions of scrapli that perhaps had a less robust in channel authentication handler. 1 second faster IOSXR for free! Yay!
- Fixed an issue with system transport where the transport would get closed twice causing an unhandled exception -- thank you to Alex Lardschneider for finding this!
- Added an example for the `enable_basic_logging` function as well as the `commandeer` method
- Improved priv level handling -- if you try to acquire "parallel" privileges (ex. configuration and configuration exclusive in IOSXR) previously we would say things worked, but we would just stay in configuration mode. This has been fixed (hopefully)!
- Move ansi escape pattern to compile globally, so it only compiles once (why it was never like that before... who knows)
- Simplify the `collect` bits for integration tests... this is still not used heavily but hopefully will be soon!
- Replace vrnetlab creds in examples with scrapli (felt confusing to have vrnetlab creds everywhere, plus functional testing is moving away from (but still supporting) vrnetlab test environment)
- Crank up the rows/cols for system transport -> 80 rows, 256 cols -- this to align with scrapligo and to make it less common that users need to modify these values.
- BUGFIX: fixed blocking read in async channel telnet authentication (thank you Dmitry Figol!)
- Added `not_contains` field to privilege levels... this will help greatly simplify the necessary regex patterns, as well as allow us to ditch look arounds which go does not support... step one to a standardized community platform that works with python -or- go!
- Simplified (at least a little... more would be good) patterns for privilege levels for core platforms.
- Added `_generic_driver_mode` to the `NetworkDriver` classes -- this is a private mode as it should probably be used cautiously -- the idea here is that you can send any strings you want and scrapli will not care about privilege levels at all. See the discussion about this [here](https://github.com/carlmontanari/scrapli/discussions/128).
- BUGFIX: fixed asynctelnet issue with control character handling, thank you to [davaeron](https://github.com/davaeron) -- see #147
- *BREAKING CHANGE* removed the `transport.username_prompt` and `transport.password_prompt` attributes of the telnet transports. All authentication has been moved into the channel, so it made no sense to leave these attributes on the transports. This may cause an issue for users that had explicitly set their prompts to something non-standard.
- Finally added logic to auto set port to 23 for telnet :)
- BUGFIX: fixed a rare issue where decoding bytes received from the channel (in the response object) would raise a `UnicodedecodEerror`; we now catch this exception and decode with `ISO-8859-1` encoding which seems to be much less picky about what it decodes. Thanks to Alex Lardschneider for yet another good catch and fix!
- Added `interaction_complete_patterns` to all "interactive" methods -- this argument accepts a list of strings/patterns; will be re-escape'd if each string does *not* start with and end with "^" and "$" (line anchors), otherwise will be compiled with the standard scrapli case-insensitive and multiline flags. If the interactive event finds any of these pattenrs during the course of the interacting it will terminate the interactive session. Note that this is entirely optional and is a keyword only argument so no changes are necessary to any existing scrapli programs.

2021.07.30a3

mostly another pre-release to keep replay/cfg chugging along toward their eventual first "real" release.

* bump pins
* deprecate comms_ansi
* convert deprecation warning -> FutureWarning so users see it
* update docs, fix some links, redeploy docs
* handle annoying rare paramiko eof at tear down of integration tests
* first swag adding 3.10 testing
* skip ssh2 on 3.10 for now
* skip pyfakefs tests on 3.10 for now
* make tests not a package.... remove unnecessary sleep for iosxr
* fix system transport double timeout issue
* add logging and commandeer example
* remove unnecessary call to strip ansi in in channel auth
* remove comms_ansi arg from tests
* handle "parallel" privs correctly (i.e. configuration and configuration_exclusive)
* Logo (121)
* change creds to just scrapli/scrapli in examples, functional test updates for lab environment
* remove unnecessary ansi strip in async channel telnet auth

Page 2 of 13

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.