-
Notifications
You must be signed in to change notification settings - Fork 34
feat: Add feature to search config #634
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
Merged
carl-baillargeon
merged 2 commits into
aristanetworks:main
from
chetryan:feature/search_running_config
Apr 19, 2024
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,6 +81,16 @@ def bgp_multiprotocol_capabilities_abbreviations(value: str) -> str: | |
return value | ||
|
||
|
||
def validate_regex(value: str) -> str: | ||
"""Validate that the input value is a valid regex format.""" | ||
try: | ||
re.compile(value) | ||
except re.error as e: | ||
msg = f"Invalid regex: {e}" | ||
raise ValueError(msg) from e | ||
return value | ||
|
||
|
||
# ANTA framework | ||
TestStatus = Literal["unset", "success", "failure", "error", "skipped"] | ||
|
||
|
@@ -129,3 +139,4 @@ def bgp_multiprotocol_capabilities_abbreviations(value: str) -> str: | |
Revision = Annotated[int, Field(ge=1, le=99)] | ||
Hostname = Annotated[str, Field(pattern=r"^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$")] | ||
Port = Annotated[int, Field(ge=1, le=65535)] | ||
RegexString = Annotated[str, AfterValidator(validate_regex)] |
Uh oh!
There was an error while loading. Please reload this page.