Scrapli

Latest version: v2024.1.30

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

Scan your dependencies

Page 3 of 13

2021.07.30a2

Releasing to help un block typing improvements in scrapli-cfg as well.

2021.07.30a1

- 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

2021.01.30

- *BREAKING CHANGE* `PrivilegeLevel` import location changed -- this will break things!
- `timeout_exit` deprecated; will always close connection on timeout now
- All exceptions rationalized/changed -- all exceptions now rooted in `ScrapliException` and scrapli should not raise any exception that is not rooted in this! It is of course possible that non-scrapli exceptions will get raised at some point, but all "common" exceptions will now follow this pattern.
- Added opinionated logging option -- should be used only for debugging/testing, otherwise use your own logging setup!
- Moved "in channel" auth into channel (for telnet/system ssh authentication)
- Added `channel_lock` option, defaults to false
- Added `channel_log` option
- Decorators got reswizzled a little, no more requires open as the transports handle this. There is now a dedicated
ChannelTimeout and TransportTimeout to keep things simpler.
- All transport plugins are now in scrapli "core"
- All (ok, most...) channel and transport args are now properties of the driver class -- this should remove confusion about where to update what timeout/value
- `Response._record_response` is now public but only for linting reasons, people generally should ignore this anyway!
- Python 3.6 will now require dataclasses backport
- All driver methods now have only the "main" argument as an allowable positional argument, the rest of the arguments are keyword-only! For example, `send_command` you can pass a positional argument for `command`, but `strip_prompt` and any additional arguments *must* be keyword arguments!
- *BREAKING CHANGE* `Scrape`/`AsyncScrape` renamed --> `Driver`/`AsyncDriver` -- given most folks should not be using these directly there will be no alias for this, just a hard change!
- More improvements to IOSXE tclsh pattern handling; handles tclsh in exec or privilege exec mode now
- `read_until_prompt_or_time` now supports regex patterns in the `channel_outputs` list (pass as a string, will be compiled for you)
- Big improvements to Factory for users of IDEs -- factories now have proper typing data so you will have nice auto completion things there/typing will be much happier

2021.01.29

- Add support for timeout_ops on send interactive
- Mostly house keeping and making this release ahead of scrapli overhaul

2021.01.17

- Support for future "vrouter" setup for testing
- Flatten all channel inputs (no pretty printed xml) -- seems to behave much more nicely across the board!
- Updated test to match some recent scrapli core updates (multipl easync transports)

2020.12.31

- Make log messages for textfsm and genie parsers failing to parse consistent as `log.warning`
- Add factory example
- Add "root" priv level to junos driver -- probably should be considered experimental for now :)
- Fix issue where `send_config` unified result did not have finish time set
- **POSSIBLY BREAKING CHANGE:** logger names have changed to be easier to get/make more sense -- the logger for each instance used to look like: "scrapli-channel-{{ HOST }}" which kinda was not really smart :). Loggers now look like: "scrapli.{{ HOST }}:{{ PORT }}.channel" -- can be channel|driver|transport!
- Changes to test environment:
- Support running devices on localhost w/ nat'd management ports -- in "vrouter" mode (poorly named) -- this is enabled with the `SCRAPLI_VROUTER` environment variable set to on/true/something
- Added bootvar into nxos base config -- when missing causes qemu nxosv to boot into loader prompt so thats no good
- Replace resource settings in vdc in nxos to account for nxos instances with differing resources (memory/cpu)
- Got rid of static license udi in iosxe config, replaced more certificate stuff so show run comparisons are easier on iosxe
- **NEW TRANSPORT** `asynctelnet` transport is built using standard library asyncio, as such it is part of scrapli core
- Should be considered beta for a while :)
- Added a bunch of tests mocking streamreader/writer to ensure that this driver is well tested
- Added asynctelnet support in nxos and juniper drivers (to change prompt for those platforms)
- Support asynctelnet in base driver
- `auth_bypass` for both telnet drivers completely bypasses not only auth (as it did previously) but also the auth validation where we confirm we got logged in successfully -- reason being is that for console servers and such you may not care about that, you may just want to log in and read data.
- Removed unnecessary re-checking/verifying of ssh config file in system transport (was basically duplicated from base transport, so was pointless!)
- Bumped all the default timeout values up as they were probably a bit on the aggressive side
- Added `eager` argument to send commands/commands from file and config/configs/configs from file methods -- basically this `eager` mode will *not* look for a prompt between lines of commands/configs. This means that things have potential to get out of whack because we will just send things as fast as possible. In order to not totally break things we *will* (whether you like it or not!) wait and find the prompt on the last command/config in the list though -- that way we dont get too out of whack. This now means we can use `eager` to configure banners and macros and things and we no longer need to do the dirty send interactive workaround.
- Added `ScrapliConnectionLost` exception and raise it if we get EOF in system transport -- with a message that is more clear than just "EOF" and some obscure line in ptyprocess!
- Added `tclsh` privilege level for IOSXE
- Fixed a bug that would prevent going to "parallel" privilege levels -- i.e. going from tclsh to configuration or visa versa in IOSXE or from configuration to configuration_exclusive in IOSXR
- If no `failed_when_contains` is passed to `send_interactive` network drivers will now use the network drivers `failed_when_contains` attribute to bring it inline with the normal command/config methods
- Added `timeout_ops` to `send_interactive` and wrap those methods with the `TimeoutModifier` decorator
- Add logic to properly fetch socket address family type so we can handle IPv6 hosts (w/ scrapli-ssh2/scrapli-paramiko)
- Added `tclsh` privilege level for NXOS, didn't even know that existed before!

Page 3 of 13

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.