Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add argument to send_command and send_command_timing to support raising exception for parsers #3494

Merged
merged 4 commits into from
Sep 4, 2024

Conversation

ktbyers
Copy link
Owner

@ktbyers ktbyers commented Sep 3, 2024

TextFSM/TTP/Genie failures should result in a NetmikoParsingException when this flag is set and an error occurs.

Kircheneer and others added 4 commits March 28, 2024 08:25
Allow exceptions from structured data parsers to bubble up to the
callers of `send_command` and `send_command_timing`. This is useful for
example in conjunction with `nornir_netmiko`, which currently can't fail
tasks based on failed parsing, leading to successful tasks with garbage
data.
@ktbyers
Copy link
Owner Author

ktbyers commented Sep 3, 2024

@Kircheneer I made some updates to make this more ubiquitous across TTP/Genie.

I also changed the behavior for TextFSM such that NetmikoParsingException is raised both for a failure to find a template and also for a valid template with some set of data that isn't parsed properly (or worded differently CLITable exception won't be raised generally NetmikoParsingException would be raised with a different message).

Let me know if this causes issues (part of the reason for me wanting to do this was to make the behavior more consistent across TTP and Genie).

@ktbyers
Copy link
Owner Author

ktbyers commented Sep 3, 2024

@tom0010 See comments to @Kircheneer (let me know if you have any feedback, otherwise, will probably merge tomorrow).

We can obviously adjust after it is merged (if necessary).

Copy link
Contributor

@Kircheneer Kircheneer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ktbyers ktbyers merged commit 4599c4d into develop Sep 4, 2024
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants