Scrapli

Latest version: v2024.1.30

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

Scan your dependencies

Page 6 of 13

2020.08.08

First pypi release of scrapli community! Thanks to wonderbred for contributing the ruckus fast iron driver! There is also a hopefully working (though I have no way to test it) Huawei VRP driver, and finally the README is in a pretty good state that should help explain what all this community thing is and how to contribute!

2020.07.26

- Fixed the same `get_prompt` issue from the last release, but this time managed to actually fix it in async version!
- Better handling of `read_until_input` -- stripping some characters out that may get inserted (backspace char), and compares a normalized whitespace version of the read output to the a normalized whitespace version of the input, fixes [36](https://github.com/carlmontanari/scrapli/issues/36).
- Improved system transport ssh error handling -- catch cipher/kex errors better, catch bad configuration messages.
- Now raise an exception if trying to use an invalid transport class for the base driver type -- i.e. if using asyncssh transport plugin with the "normal" sync driver class.
- Added links to the other projects in the scrapli "family" to the readme.
- Created first draft of the scrapli "factory" -- this will allow users to provide the platform name as a string to a single `Scrapli` or `AsyncScrapli` class and it will automagically get the right platform driver selected and such. This is also the first support for `scrapli_community`, which will allow users to contribute non "core" platforms and have them be usable in scrapli just like "normal".
- Overhaul decorators for timeouts into a single class (for sync and async), prefer to use signals timeout method where possible, fall back to multiprocessing timeout where required (multiprocessing is slower/more cpu intensive so dont use it if we dont have to).

2020.07.12

- Fixed a silly issue where `get_prompt` was setting the transport timeout to 10s causing user defined timeouts to be effectively ignored.
- Improved telnet authentication handling -- previously if a return character was needed to get the auth prompts to kick into gear this could break auth.
- Added "auth_bypass" to telnet transport.
- Probably BUGFIX -- async functions were being decorated by the "normal" `operation_timeout` decorator -- created a mostly duplicated async version of the timeout decorator to wrap the `AsyncChannel` methods.
- Fixed a maybe regression that caused drivers to try to authenticate (via interactive methods) even if a `auth_secondary` is not set. Added tests to make sure that we raise a warning if there is no secondary password set, but try to increase privilege without authentication, and of course if there is an auth secondary set, we obviously try to auth in the normal fashion.
- Started thinning down the PtyProcess stuff to simplify and and remove all unnecessary parts, as well as add typing and docstrings... not done yet, but some progress!
- Added additional asyncio example
- Added blurb about versioning in README
- Fixed a few README issues (incorrect methods/typos)
- Updated notes about auth_bypass to include telnet support
- Added `SSHNotFound` exception for system SSH/PtyProcess if ssh binary can't be found

2020.07.04

Mostly a release for some internal work as well as scrapli_netconf

- Updated IOSXE base config to include netconf setup for consistency w/ scrapli_netconf
- Removed "pipes" authentication for system ssh -- this is mostly an internal change that simplifies the way that
system transport authenticates. We lose the ability to very easily read out of stderr what is going on so even if we auth with a key now we have to "confirm" that we are authenticated, but this removes a fair bit of code and unifies things as well as allows for the next line item...
- Added support for `auth_private_key_passphrase` to system transport -- allows for entering ssh key passphrase to decrypt ssh keys
- Added an example on how to deal with "weird" things like banners and macros -- these types of things change how the ssh channel works in that they are pseudo "interactive" -- meaning the prompt is modified/removed so scrapli can't ever "know" when a command is done inserting. It would be possible to support these types of config items more "natively" but doing so would lose some of the smarts about how scrapli enters/confirms inputs sent, so for now (and probably for forever) these will need to be configured in a "special" fashion
- Updated IOSXE for functional tests to use 16.12.03 -- this includes updates to the base config/expected configs... AFAIK there is some better netconf/restconf support in this version which may be handy for tests for scrapli-netconf
- Update channel/drivers to never decode bytes -- this now only happens in the response object; primary motivation for this is to not have to decode/re-encode in general, and in scrapli-netconf in particular

2020.06.06

- Converted all priv levels to be kwargs instead of just args for setup -- simple thing but makes it more readable IMO.
- Added to the Juniper prompt pattern to include matching the RE prompt that is on the line "above" the "normal
" prompt as this was getting included in command output instead of being seen as part of the prompt by scrapli.
- Convert driver privilege escalation prompts to use regex to match upper and lower case "P" in password prompt
- Fix core drivers to actually allow for users to pass `failed_when_contains`, `textfsm_platform`, `genie_platform`, and `default_desired_privilege_level`
- Add better exception/message for attempting to send command/config to a connection object that has not been opened
- Add testing for on open/close methods of core drivers
- Add `send_config` method to send a single configuration string -- this will automagically handle sending a full configuration, breaking it into a list of configs, sending that list with `send_configs` and then joining the responses into a single `Response` object... or of course you can just send a single config line with it too!
- Add better handling/logging for `SystemSSH` transport when key exchange cannot be negotiated
- Convert the `_failed()` method of `MultiResponse` to be a property so users can check `.failed` on a `MultiResponse` object more intuitively/sanely
- ASYNC ALL THE THINGS... basically only an internal change, but hugely modified the guts of scrapli to try to be able to best support asyncio while still having the same api for sync and async. Again, if you dont care about aysncio this probably doesnt matter at all as all the "public" stuff has not changed for sync versions of things.
- Completely overhaul unit tests -- unit tests now spin up an SSH server using asyncssh, this server is a very basic implementation of an IOSXE device. This fake IOSXE device allows for connecting/sending commands/handling log on stuff like disabling paging all in as close to the real thing as possible while being completely self contained and completely in python. Additionally since there was a lot of changes to break things out to be more granular with the async implementation the testing has evolved to support this.
- Increased all hostname patterns to match up to 63 characters -- this is the hostname length limit for Cisco IOSXE at least and should be a reasonable value that hopefully doesnt really ever need to be changed/expanded now
- Changing logging to create a logger associated with each object instance and include the name/ip of the host in the log name -- should make things a lot nicer with threads/asyncio/etc.
- Moved from tox to using nox for handling tests/linting; originally this was because of some of the unit testing failing when ran via tox (now I believe this was because there was no TERM env var set in tox), but at this point nox is quite nice so we'll stick with it!
- Added exception to be raised when users try to use system transport on Windows
- BUGFIX: Added underscores to hostname patterns for IOSXE, IOSXR, NXOS, and Junos (not valid in EOS at least in my testing)
- No more Windows testing, not worth the effort
- BUGFIX: Added functionality to merge less specific (but matching) host entry data for ssh config file hosts -- meaning that we can now merge attributes from a "*" entry into a more specific host entry (see 21)
- Add dependabot to see how we like having that friend around...
- Moved from tox -> nox; long story as to why, but very much like nox!
- fixed some docstrings and re-added darglint into the mix
- Added a "debug" workflow for connecting to runner containers for testing stuff... hopefully wont need to be used often
- Modified workflows a bit to use nox, add darglint back in, and lint more stuff on weekly build (next weekly build may fail if dev doesnt get pulled into master :))
- Updated readme to include async stuff
- Added a basic async example
- Regen docs

2020.05.09

- Add underscores to EOS config prompt matching
- Actually fixed on_close methods that I could have sworn were fixed.... gremlins! (was sending prompt pattern instead of a return char... for copypasta reasons probably)
- No longer "exit" config mode... given that send_command like methods already check to ensure they are in the right priv level there is no reason to exit config mode... just leave it when you need to. Should be a minor speed up if using send_configs more than once in a row, and otherwise should be basically exactly the same.
- For NetworkDrivers we no longer set the channel prompt pattern depending on the priv level -- it is now always the combined pattern that matches all priv levels... this should make doing manual things where you change privileges and don't use scrapli's built in methods a little easier. Scrapli still checks that the current prompt matches where it thinks it should be (i.e. config mode vs privileged exec) though, so nothing should change from a user perspective.
- Improve (fix?) the abort config setup for IOSXR/Junos
- Add more helpful exception if ssh key permissions are too open
- Convert PrivilegeLevel from a namedtuple to a class with slots... better for typing and is also mutable so users can more easily update the pattern for a given privilege level if so desired
- Minor clean up stuff for all the core platforms and network driver, all internal, mostly just about organization!
- Add "configuration_exclusive" privilege level for IOSXRDriver, add "configuration_private" and "configuration_exclusive" for JunosDriver, modify some of the privilege handling to support these modes -- these can be accessed by simply passing privilege_level="configuration_exclusive" when using send_configs method
- Add support for configuration sessions for EOS/NXOS. At this time sessions need to be "registered" as a privilege level, and then are requestable like any other privilege level, and can be used when sending configs by passing the name of your session as the privilege level argument for send config methods
Add a space to EOS prompts -- it seems its very easy to add one to the prompts and scrapli did not enjoy that previously!
- Give users the option to pass in their own privilege levels for network drivers, and also throw a warning if users try to pass comms_prompt_pattern when using network drivers (as this should all be handled by priv levels)
- Created MultiResponse object to use instead of a generic list for grouping multiple Response objects
Added raise_for_status methods to Response and MultiResponse -- copying the requests style method here to raise an exception if any elements were failed
- BUGFIX: fixed an issue with IOSXEDriver not matching the config mode pattern for ssh pub key entries.

Page 6 of 13

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.