Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package nvmetcli for openSUSE:Factory 
checked in at 2025-03-26 21:20:38
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/nvmetcli (Old)
 and      /work/SRC/openSUSE:Factory/.nvmetcli.new.2696 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "nvmetcli"

Wed Mar 26 21:20:38 2025 rev:18 rq:1256129 version:0.8

Changes:
--------
--- /work/SRC/openSUSE:Factory/nvmetcli/nvmetcli.changes        2024-03-11 
15:42:16.456852486 +0100
+++ /work/SRC/openSUSE:Factory/.nvmetcli.new.2696/nvmetcli.changes      
2025-03-26 21:23:20.374306537 +0100
@@ -1,0 +2,6 @@
+Thu Mar 20 08:46:34 UTC 2025 - Michal Suchanek <msucha...@suse.de>
+
+- Drop dependency on unmaintained kmodpy
+  * When-kmodpy-is-not-available-call-kmod-binary-directly.patch
+
+-------------------------------------------------------------------

New:
----
  When-kmodpy-is-not-available-call-kmod-binary-directly.patch

BETA DEBUG BEGIN:
  New:- Drop dependency on unmaintained kmodpy
  * When-kmodpy-is-not-available-call-kmod-binary-directly.patch
BETA DEBUG END:

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ nvmetcli.spec ++++++
--- /var/tmp/diff_new_pack.3adpdl/_old  2025-03-26 21:23:21.158339077 +0100
+++ /var/tmp/diff_new_pack.3adpdl/_new  2025-03-26 21:23:21.158339077 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package nvmetcli
 #
-# Copyright (c) 2024 SUSE LLC
+# Copyright (c) 2025 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -26,6 +26,7 @@
 Source:         nvmetcli-v%{version}.tar.gz
 Patch1:         nvmetcli-update-python-to-python3.patch
 Patch2:         harden_nvmet.service.patch
+Patch3:         When-kmodpy-is-not-available-call-kmod-binary-directly.patch
 BuildRequires:  %{pythons}
 BuildRequires:  fdupes
 BuildRequires:  python3-pip
@@ -33,10 +34,9 @@
 BuildRequires:  python3-setuptools
 BuildRequires:  python3-wheel
 Requires:       python3-configshell-fb
-Requires:       python3-kmodpy
 Requires(post): systemd
-Requires(postun): systemd
-Requires(preun): systemd
+Requires(postun):systemd
+Requires(preun):systemd
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 BuildArch:      noarch
 

++++++ When-kmodpy-is-not-available-call-kmod-binary-directly.patch ++++++
>From c2f8f2713398bbecc398ac4e3c1b99adbe893c45 Mon Sep 17 00:00:00 2001
From: Michal Suchanek <msucha...@suse.de>
Date: Thu, 20 Mar 2025 09:34:10 +0100
Subject: [PATCH] When kmodpy is not available call kmod binary directly

kmodpy is an unmaintained project. Python is not really good at
backwards compatibility. With the upstream project not keeping up with
python churn using the library is a maintenance burden.

nvmet does not use the python library in any substantial way, it only
loads a module once. This can be easily accomplished without any library
using the modprobe tool directly.
---
 nvmet/nvme.py | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/nvmet/nvme.py b/nvmet/nvme.py
index 59efdb5b7c1b..397f103abcdb 100644
--- a/nvmet/nvme.py
+++ b/nvmet/nvme.py
@@ -256,9 +256,20 @@ class Root(CFSNode):
             # Try the ctypes library included with the libkmod itself.
             try:
                 import kmod
-                kmod.Kmod().modprobe(modname)
-            except Exception as e:
-                pass
+
+                try:
+                    kmod.Kmod().modprobe(modname)
+                except Exception as e:
+                    pass
+            except ImportError:
+                # Try the binary specified in /proc
+                try:
+                    kmod = None
+                    with open('/proc/sys/kernel/modprobe', 'r') as f:
+                        kmod = f.read().rstrip()
+                    os.system(kmod + ' ' + modname)
+                except Exception as e:
+                    pass
 
     def _list_subsystems(self):
         self._check_self()
-- 
2.47.1

Reply via email to