Skip to content

Conversation

@julmanglano
Copy link
Contributor

New Pull Request

Have you:

  • Updated the README if necessary?
  • Updated any configuration settings?
  • Written a unit test?

Change Notes

Added fix for finding banner delimiter when banner is at the end of the config ( IOSXR)

Justification

Closes #614

jeffkala and others added 30 commits December 2, 2021 11:51
…tworktocode#83)

* remove support for old function as prep for 1.0.0

* remove is_fqdn_valid jinja map

* prep for 1.0.0 release
…top_lines

Dynamically gather start and end lines for doc testing
* Added uptime conversion functions
* fix: 🐛 Handle 0 decimal place rounding for bits_to_name

There appears to be a quirk with the round method that it will show the number as a float if you specify 0 decimal places and as an int if you don't specify the places at all. This tweak should fix the issue.
…e#104)

* Removed double for loop and use builtin regex to find all matches across lines.

* Change multiline test to include minimal vlan range of concurrent (2), ex. 1912-1913

* Corrected checking max vlan back to original checking the last element.
* Add grouping_size to vlanlist_to_config.

* Add tests for and logic to assert group size is not less than 2.

* Allow grouping size of 1, but it returns the vlan list, sorted, and joined with no special processing.

* Update netutils/vlan.py

Co-authored-by: Ken Celenza <[email protected]>

* Update netutils/vlan.py

Co-authored-by: Jeff Kala <[email protected]>

Co-authored-by: Ken Celenza <[email protected]>
Co-authored-by: Jeff Kala <[email protected]>
* test: ✅ Add SrOS config samples for parser

* feat: ✨ Add SrOS parser utilizing section banners as config section parents

In order to allow the config section banners to be used for specifying a section in parsing I've simplified it so those banner names are the parent for the section. Should allow for a user to specify "System Configuration" for a section and get the full block.

* refactor: 🔥 Remove config_lines_only method

Realized I could use the inherited method just as well as the one I'd written so getting rid of unnecessary code.

* refactor: 🔥 Remove unused method

* docs: Remove reference to Fortinet

* refactor: 🚚 Rename methods to be private per convention

* fix: Simply comment character to just hash symbol

* test: ✅ Add SROS base config sample for parser test

* test: ✅ Add SROS compliance tests

* test: ✅ Add diff_network_config test for SROS parser

* test: ✅ Add SROS config test for config not parsed

* test: ✅ Fix config_section_not_parsed test for SROS

Updated test to use post-processed config for the test

* build: Increment project minor version to 1.1.0

* docs: 📝 Add note about SROS edge case config modification

Co-authored-by: Justin Drew <[email protected]>
* Updated lib mapping docs

* Updated per review suggestions
* initial pass at type hinting and getting mypy to run

* update tasks and ci to do mypy as well

* rm unused import

* fix contributing end-line number

* fix contributing end-line number

* Add py.typed file to signify availability of type hints to third parties.

* Updates to type hinting.

* Add EOS _build_banner type hints.

* Address feedback.

* Linting.

* Remove .idea from commit and ignore in .gitignore.

* Remove remnants of merge conflict.

* PR feedback.

* PR comments.

* Ignore pylint errors for abstract-method.

* Black.

* add examples and better exception messaging

Co-authored-by: Leo Kirchner <[email protected]>
* prep for 1.2.0 release

* Update CHANGELOG.md

Co-authored-by: Jeff Kala <[email protected]>

Co-authored-by: Jeff Kala <[email protected]>
* Updated lib mapping docs (networktocode#113)

* Updated lib mapping docs

* Updated per review suggestions

* Pinned mistune for m2r2 (networktocode#114)

* Switch to poetry-core

* Update banner parsing for EOS (networktocode#121)

Update banner parsing for EOS

* Fixes encrypt type7 (networktocode#122)

* fixes encrypt type7

* Document support on duplicate lines (networktocode#128)

* Few updates to PR of 125 (networktocode#129)

* initial pass at type hinting and getting mypy to run

* update tasks and ci to do mypy as well

* rm unused import

* fix contributing end-line number

* fix contributing end-line number

* Add py.typed file to signify availability of type hints to third parties.

* Updates to type hinting.

* Add EOS _build_banner type hints.

* Address feedback.

* Linting.

* Remove .idea from commit and ignore in .gitignore.

* Remove remnants of merge conflict.

* PR feedback.

* PR comments.

* Ignore pylint errors for abstract-method.

* Black.

* add examples and better exception messaging

Co-authored-by: Leo Kirchner <[email protected]>

* Adding nxos_ssh to Napalm mapper (networktocode#138)

* Update CODEOWNERS (networktocode#134)

adding codeowner

* prep for 1.2.0 release (networktocode#143)

* prep for 1.2.0 release

* Update CHANGELOG.md

Co-authored-by: Jeff Kala <[email protected]>

Co-authored-by: Jeff Kala <[email protected]>

Co-authored-by: Adam Byczkowski <[email protected]>
Co-authored-by: Fabian Affolter <[email protected]>
Co-authored-by: Ken Celenza <[email protected]>
Co-authored-by: Dr. X <[email protected]>
Co-authored-by: Leo Kirchner <[email protected]>
Co-authored-by: Joe Wesch <[email protected]>
Co-authored-by: Andrew Bates <[email protected]>
* adds utility functions ios

* addresses comments

* addresses comments

* adds tests

* addresses comments

* addresses comment parametrize tests
julmanglano and others added 2 commits May 19, 2025 11:02
@qduk
Copy link
Collaborator

qduk commented May 22, 2025

Would it make any sense to put the call to self.set_delimeter() in self._build_banner? Or possibly a parent one?

…ion to munge the data in a os centric view versus a lib centric view. (networktocode#644)
compliance.parser_map["cisco_ios"](logging).config_lines # pylint: disable=expression-not-assigned


def test_banner_delimiter_iosxr():
Copy link
Contributor

Choose a reason for hiding this comment

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

These tests may be good, but hard for me to understand, can you add to a mock test here: https://github.com/networktocode/netutils/tree/develop/tests/unit/mock/config/parser/base/cisco_iosxr

bminnix and others added 17 commits July 11, 2025 07:53
* Flat: latest data (2025-06-01T02:43:49.033Z)
{
  "date": "2025-06-01T02:43:49.033Z",
  "files": [
    {
      "name": "netutils/data_files/oui_mappings.py",
      "deltaBytes": 7279,
      "source": "https://standards-oui.ieee.org"
    }
  ]
}

* Flat: latest data (2025-06-01T02:48:51.338Z)
{
  "date": "2025-06-01T02:48:51.338Z",
  "files": [
    {
      "name": "netutils/data_files/protocol_mappings.py",
      "deltaBytes": 62,
      "source": "https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.csv"
    }
  ]
}

* Updated teh URL for cpeName (didn't make it into last commit) and updated tests for it.

* Made changes to the URL creation using cpeName instead of virtualMatchString, fixed nxos, added aruba and paloalto, update get_nist_urls() to use NIST_LIB_MAPPER_REVERSE_DICT

* Removing TODO comment on NIST_LIB_MAPPER_REVERSE

* Added panos to the reverse mapper and alphabetized all NIST mapper entries.

* Ran developmen_scripts again

* Missed alphabetization on cisco_asa in the reverse dict

* Renamed NIST_LIB_MAPPER_REVERSE_DICT to NIST_TO_VENDOR

* Reverted the version bump

* Fixing value in lib_mapper NIST_TO_VENDOR for adaptive_security_appliance_software

* Updating lib_mapper NIST_TO_VENDOR for ios xe and xr

---------

Co-authored-by: flat-data <[email protected]>
…tocode#672)

* fix running commands to full update oui and protocol mappers

* fix encoding in mapper docs
…code#676)

* fixes networktocode#675, fixes ruff formatting and linting

* update ci file with new tests

* add back mypy

* add back mypy

* fix ci need matrix

* fix ci need matrix

* cleanup docstrings
* Add Nvidia Onyx config parser
* Update constants.py


Co-authored-by: Jeff Kala <[email protected]>

---------

Co-authored-by: Ken Celenza <[email protected]>
Co-authored-by: Jeff Kala <[email protected]>
update doc string and mypy to get tests working


Co-authored-by: Dmitry Babkin <[email protected]>
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.

CiscoIOSXRConfigParser fails with ValueError: empty separator when the banner is at the end of a config.