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 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/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/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/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 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", 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