File: pysnmp7-compat.patch

package info (click to toggle)
ironic 1%3A32.0.0-4
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 22,992 kB
  • sloc: python: 184,221; sh: 3,917; pascal: 766; xml: 387; makefile: 86
file content (21 lines) | stat: -rw-r--r-- 709 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Description: pysnmp 7 compat
Author: Thomas Goirand <zigo@debian.org>
Forwarded: no
Last-Update: 2025-09-30

Index: ironic/ironic/drivers/modules/snmp.py
===================================================================
--- ironic.orig/ironic/drivers/modules/snmp.py
+++ ironic/ironic/drivers/modules/snmp.py
@@ -41,7 +41,10 @@ from ironic.drivers import base
 pysnmp = importutils.try_import('pysnmp')
 if pysnmp:
     from pysnmp import error as snmp_error
-    from pysnmp import hlapi as snmp
+    try:
+        from pysnmp.hlapi.v3arch import asyncio as snmp
+    except ImportError:
+        from pysnmp import hlapi as snmp
 
     snmp_auth_protocols = {
         'md5': snmp.usmHMACMD5AuthProtocol,