17
0

Compare commits

4 Commits

3 changed files with 44 additions and 6 deletions

27
py313.patch Normal file
View File

@@ -0,0 +1,27 @@
Index: napalm-procurve-0.7.0/napalm_procurve/procurve.py
===================================================================
--- napalm-procurve-0.7.0.orig/napalm_procurve/procurve.py
+++ napalm-procurve-0.7.0/napalm_procurve/procurve.py
@@ -23,7 +23,12 @@ from __future__ import unicode_literals
import re
import sys
import socket
-import telnetlib
+try:
+ from telnetlib import IAC, NOP
+except ImportError:
+ # Python 3.13+ has dropped telnetlib
+ IAC = chr(255)
+ NOP = chr(241)
from netmiko import ConnectHandler
from napalm.base.base import NetworkDriver
@@ -129,7 +134,7 @@ class ProcurveDriver(NetworkDriver):
if self.transport == "telnet":
# Try sending IAC + NOP (IAC is telnet way of sending command
# IAC = Interpret as Command (it comes before the NOP)
- self.device.write_channel(telnetlib.IAC + telnetlib.NOP)
+ self.device.write_channel(IAC + NOP)
return {"is_alive": True}
else:
# SSH

View File

@@ -1,3 +1,14 @@
-------------------------------------------------------------------
Fri Aug 1 04:12:54 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
- Switch to pyproject macros.
-------------------------------------------------------------------
Thu Dec 12 12:52:32 UTC 2024 - Markéta Machová <mmachova@suse.com>
- Add patch py313.patch to fix compatibility with Python 3.13
* sent upstream in https://github.com/ixs/napalm-procurve/pull/33
-------------------------------------------------------------------
Wed Jan 11 08:25:45 UTC 2023 - Matej Cepl <mcepl@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-napalm-procurve
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2025 SUSE LLC
# Copyright (c) 2019, Martin Hauke <mardnh@gmx.de>
#
# All modifications and additions to the file contributed by third parties
@@ -17,8 +17,6 @@
#
# python-napalm is python3 only
%define skip_python2 1
Name: python-napalm-procurve
Version: 0.7.0
Release: 0
@@ -31,6 +29,8 @@ Patch0: setup-parse-requirements.patch
Patch1: float-speed.patch
#PATCH-FIX-OPENSUSE fix-linter.patch remove pyflakes from code lint because it's failing
Patch2: fix-linter.patch
# PATCH-FIX-UPSTREAM https://github.com/ixs/napalm-procurve/pull/33 compatibility with Python 3.13
Patch3: py313.patch
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: python-rpm-macros
@@ -55,10 +55,10 @@ ProCurve driver support for Napalm network automation.
sed -i -e '/addopts/d' setup.cfg
%build
%python_build
%pyproject_wheel
%install
%python_install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
@@ -70,6 +70,6 @@ sed -i -e '/addopts/d' setup.cfg
%license LICENSE
%doc AUTHORS README.md
%{python_sitelib}/napalm_procurve
%{python_sitelib}/napalm_procurve-%{version}*-info
%{python_sitelib}/napalm_procurve-%{version}.dist-info
%changelog