From 551c3b95ae91194dd25dddfa3207ed3ebecf8767 Mon Sep 17 00:00:00 2001 From: Jeroen van Bemmel Date: Fri, 27 Oct 2023 14:29:17 +0000 Subject: [PATCH 1/5] Update regex expression --- napalm_sros/sros.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/napalm_sros/sros.py b/napalm_sros/sros.py index e36e1f9..f405725 100644 --- a/napalm_sros/sros.py +++ b/napalm_sros/sros.py @@ -422,7 +422,7 @@ def compare_config(self): if not first_compare and "compare" in item: first_compare = True continue - elif "(ex)[]" in item: + elif re.search(r'\(ex\)\[\/?\]', item): continue elif "/environment more false" in item: continue From b2549649948cb6dc59c87ee63fec54c71466ad48 Mon Sep 17 00:00:00 2001 From: Jeroen van Bemmel Date: Fri, 27 Oct 2023 15:38:50 +0000 Subject: [PATCH 2/5] * Remove end-of-life Python 3.7 * Add newly released Python 3.12 --- .github/workflows/napalm-sros-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/napalm-sros-ci.yml b/.github/workflows/napalm-sros-ci.yml index 402b5f4..8fd120d 100644 --- a/.github/workflows/napalm-sros-ci.yml +++ b/.github/workflows/napalm-sros-ci.yml @@ -8,7 +8,7 @@ jobs: strategy: max-parallel: 5 matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v3 From 5543379d07742666ceed46fd3adf03b061714803 Mon Sep 17 00:00:00 2001 From: Jeroen van Bemmel Date: Fri, 27 Oct 2023 15:44:23 +0000 Subject: [PATCH 3/5] Bump ncclient version --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 98b21ca..70de7e0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,7 +5,7 @@ pip>=21.3.1 textfsm paramiko>=2.11.0 lxml>=4.9.1 -ncclient>=0.6.13 +ncclient>=0.6.15 xmltodict>=0.12.0 dictdiffer>=0.9.0 datetime>=4.7 From b24e2e361aa1f251ae09932a86fbe7f25539ac37 Mon Sep 17 00:00:00 2001 From: Jeroen van Bemmel Date: Sat, 4 May 2024 05:06:30 +0000 Subject: [PATCH 4/5] Update get_config method signature, handle mock attribute --- napalm_sros/sros.py | 5 +++-- test/unit/conftest.py | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/napalm_sros/sros.py b/napalm_sros/sros.py index 5a3df56..1dcd029 100644 --- a/napalm_sros/sros.py +++ b/napalm_sros/sros.py @@ -1105,6 +1105,7 @@ def get_config( retrieve="all", full=False, sanitized=False, + format="text", ): """ Return the configuration of a device. @@ -1128,7 +1129,7 @@ def get_config( """ try: configuration = {"running": "", "candidate": "", "startup": ""} - if self.sros_get_format == "cli" and (sanitized is True or sanitized is False): + if self.sros_get_format == "cli" or format == "cli": # Getting output in MD-CLI format # retrieving config using md-cli cmd_running = "admin show configuration | no-more" @@ -1190,7 +1191,7 @@ def _update_buff(buff): return configuration # returning the config in xml format - elif self.sros_get_format == "xml" and (sanitized is True or sanitized is False): + elif self.sros_get_format == "xml" or format == "xml": config_data_running_xml = "" if retrieve == "running" or retrieve == "all": config_data_running = to_ele( diff --git a/test/unit/conftest.py b/test/unit/conftest.py index ecc55e6..e74b07e 100644 --- a/test/unit/conftest.py +++ b/test/unit/conftest.py @@ -60,6 +60,7 @@ class FakeNokiaSROSDevice(BaseTestDouble): def __init__(self): self.get = FakeGetMethod(self) self.get_config = FakeGetConfigMethod(self) + self.server_capabilities = [] def open(self): pass From b6218e4e4754b41796a020d5fed7cc80d4441296 Mon Sep 17 00:00:00 2001 From: Jeroen van Bemmel Date: Sat, 4 May 2024 05:13:03 +0000 Subject: [PATCH 5/5] Update to release 1.0.2, remove Python 3.7 aligned with NAPALM core project, add Python 3.12 --- Makefile | 2 +- pyproject.toml | 6 +++--- setup.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 72200b3..99757fb 100644 --- a/Makefile +++ b/Makefile @@ -32,4 +32,4 @@ dist: ## This creates a ./dist directory with wheel package release: dist ## release to PyPi python3 -m pip install --upgrade twine # --repository testpypi - python3 -m twine upload dist/* + python3 -m twine upload --repository napalm-sros dist/* diff --git a/pyproject.toml b/pyproject.toml index 7b769b0..afd8ca2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,19 +4,19 @@ build-backend = "setuptools.build_meta" [project] name = "napalm-sros" -version="1.0.1" +version="1.0.2" description="Network Automation and Programmability Abstraction Layer driver for Nokia SR OS" readme = "README.md" -requires-python = ">=3.7" +requires-python = ">=3.8" dynamic = [ "dependencies" ] classifiers = [ "Topic :: System :: Networking", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Natural Language :: English", ] diff --git a/setup.py b/setup.py index 810ad71..6ea10da 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setup( name="napalm-sros", - version="1.0.1", + version="1.0.2", packages=find_packages(), package_data={"napalm_sros.templates": ["*.js"], "napalm_sros.utils.textfsm_templates": ["*.tpl"]}, author="Nokia", @@ -17,11 +17,11 @@ classifiers=[ "Topic :: Utilities", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Natural Language :: English", "Development Status :: 4 - Beta", "License :: OSI Approved :: Apache Software License",