From 93a11a7de0ac53402241041e02e5751e338f3d89 Mon Sep 17 00:00:00 2001 From: Jeroen van Bemmel <jvb127@gmail.com> Date: Sat, 4 May 2024 03:32:28 +0000 Subject: [PATCH 1/5] Remove Python 3.7, add 3.12 to tests --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 988766b..f2ce5cb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,7 +10,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"] # in line with Napalm base project steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} From a83d5f32d57bbc35e4a6558315bcc66211fc19dd Mon Sep 17 00:00:00 2001 From: Jeroen van Bemmel <jvb127@gmail.com> Date: Sat, 4 May 2024 03:56:40 +0000 Subject: [PATCH 2/5] Update config files --- pyproject.toml | 4 ++-- setup.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a155c1d..04eb2a8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,16 +7,16 @@ name = "napalm-srl" version="1.0.4" description="Network Automation and Programmability Abstraction Layer driver for Nokia SR Linux" 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", ] authors = [ diff --git a/setup.py b/setup.py index c4567c7..c872be4 100644 --- a/setup.py +++ b/setup.py @@ -17,17 +17,17 @@ 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", 'Operating System :: POSIX :: Linux', 'Operating System :: MacOS', ], url="https://github.com/napalm-automation-community/napalm-srlinux", - python_requires=">=3.7", + python_requires=">=3.8", include_package_data=True, install_requires=reqs, ) From 6c23e63ca26ddc66e1a245b6a1eac11f5cbb65b4 Mon Sep 17 00:00:00 2001 From: Jeroen van Bemmel <jvb127@gmail.com> Date: Sat, 4 May 2024 04:05:03 +0000 Subject: [PATCH 3/5] Fix method signature for get_config --- napalm_srl/srl.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/napalm_srl/srl.py b/napalm_srl/srl.py index 5ab832c..c76ac8a 100644 --- a/napalm_srl/srl.py +++ b/napalm_srl/srl.py @@ -1675,7 +1675,13 @@ def get_snmp_information(self): # } - def get_config(self, retrieve='all', full=False, sanitized=False): + def get_config( + self, + retrieve: str = "all", + full: bool = False, + sanitized: bool = False, + format: str = "text", # Currently ignored + ): """ :param retrieve: Which configuration type you want to populate, default is all of them. The rest will be set to “”. :param full:Retrieve all the configuration. For instance, on ios, “sh run all”. From 1d7d505a64e0b43383fe3157e2ff8f2c52127a66 Mon Sep 17 00:00:00 2001 From: Jeroen van Bemmel <jvb127@gmail.com> Date: Sat, 4 May 2024 04:11:55 +0000 Subject: [PATCH 4/5] Use 'format' parameter --- napalm_srl/srl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/napalm_srl/srl.py b/napalm_srl/srl.py index c76ac8a..58cc43c 100644 --- a/napalm_srl/srl.py +++ b/napalm_srl/srl.py @@ -1680,7 +1680,7 @@ def get_config( retrieve: str = "all", full: bool = False, sanitized: bool = False, - format: str = "text", # Currently ignored + format: str = "json", # This driver supports 'cli' or 'text' for CLI, or default 'json' ): """ :param retrieve: Which configuration type you want to populate, default is all of them. The rest will be set to “”. @@ -1697,7 +1697,7 @@ def get_config( "startup": "" } - if self.running_format == 'cli': + if self.running_format == 'cli' or format in ['cli','text']: if sanitized: raise NotImplementedError( "sanitized=True is not implemented with CLI format") From 280fc90b13bad0a34bf22a6ec7135b8f445f91ea Mon Sep 17 00:00:00 2001 From: Jeroen van Bemmel <jvb127@gmail.com> Date: Sat, 4 May 2024 04:19:57 +0000 Subject: [PATCH 5/5] Parameter default value must match too --- napalm_srl/srl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/napalm_srl/srl.py b/napalm_srl/srl.py index 58cc43c..b9e92e2 100644 --- a/napalm_srl/srl.py +++ b/napalm_srl/srl.py @@ -1680,7 +1680,7 @@ def get_config( retrieve: str = "all", full: bool = False, sanitized: bool = False, - format: str = "json", # This driver supports 'cli' or 'text' for CLI, or default 'json' + format: str = "text", # This driver supports 'cli' for CLI, else default 'json' ): """ :param retrieve: Which configuration type you want to populate, default is all of them. The rest will be set to “”. @@ -1697,7 +1697,7 @@ def get_config( "startup": "" } - if self.running_format == 'cli' or format in ['cli','text']: + if self.running_format == 'cli' or format == 'cli': if sanitized: raise NotImplementedError( "sanitized=True is not implemented with CLI format")