parent
11b4afa578
commit
2ec6df3625
@ -1 +1 @@
|
||||
SOURCES/setroubleshoot-3.3.31.tar.gz
|
||||
SOURCES/setroubleshoot-3.3.32.tar.gz
|
||||
|
@ -1 +1 @@
|
||||
de3b0332343e477ff28c3b92c9af5e15ee348106 SOURCES/setroubleshoot-3.3.31.tar.gz
|
||||
6ee4101312b8c2b98ea7d007eccd62918f59c4f3 SOURCES/setroubleshoot-3.3.32.tar.gz
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,71 @@
|
||||
From 2f9e575333af7c7798956f211c29a46a338155e5 Mon Sep 17 00:00:00 2001
|
||||
From: Petr Lautrbach <lautrbach@redhat.com>
|
||||
Date: Mon, 24 Jul 2023 17:33:17 +0200
|
||||
Subject: [PATCH] 'imp' module is deprecated in favor of 'importlib'
|
||||
Content-type: text/plain
|
||||
|
||||
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2224393
|
||||
---
|
||||
src/setroubleshoot/util.py | 26 ++++++++------------------
|
||||
1 file changed, 8 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/src/setroubleshoot/util.py b/src/setroubleshoot/util.py
|
||||
index 0e02f12de682..828a598ef1c2 100755
|
||||
--- a/src/setroubleshoot/util.py
|
||||
+++ b/src/setroubleshoot/util.py
|
||||
@@ -73,6 +73,7 @@ import datetime
|
||||
from dasbus.connection import SystemMessageBus
|
||||
import glob
|
||||
from gi.repository import GObject
|
||||
+import importlib
|
||||
import os
|
||||
import pwd
|
||||
import re
|
||||
@@ -771,37 +772,26 @@ def load_plugins(filter_glob=None):
|
||||
|
||||
# load the parent (e.g. the package containing the submodules), required for python 2.5 and above
|
||||
module_name = plugin_base
|
||||
- plugin_name = '__init__'
|
||||
if module_name not in sys.modules:
|
||||
try:
|
||||
- import imp
|
||||
- mod_fp, mod_path, mod_description = imp.find_module(plugin_name, [plugin_dir])
|
||||
- mod = imp.load_module(module_name, mod_fp, mod_path, mod_description)
|
||||
+ mod_spec = importlib.util.spec_from_file_location(plugin_base, plugin_dir + "/__init__.py")
|
||||
+ mod = importlib.util.module_from_spec(mod_spec)
|
||||
+ mod_spec.loader.exec_module(mod)
|
||||
except Exception as e:
|
||||
syslog.syslog(syslog.LOG_ERR, "failed to initialize plugins in %s: %s" % (plugin_dir, str(e)))
|
||||
return []
|
||||
|
||||
- if mod_fp:
|
||||
- mod_fp.close()
|
||||
-
|
||||
for plugin_name in plugin_names:
|
||||
module_name = "%s.%s" % (plugin_base, plugin_name)
|
||||
- mod = sys.modules.get(module_name)
|
||||
- if mod is not None:
|
||||
- log_debug("load_plugins() %s previously imported" % module_name)
|
||||
- plugins.append(mod.plugin())
|
||||
- continue
|
||||
+
|
||||
try:
|
||||
- import imp
|
||||
- mod_fp, mod_path, mod_description = imp.find_module(plugin_name, [plugin_dir])
|
||||
- mod = imp.load_module(module_name, mod_fp, mod_path, mod_description)
|
||||
+ mod_spec = importlib.util.spec_from_file_location(module_name, plugin_dir + "/" + plugin_name + ".py")
|
||||
+ mod = importlib.util.module_from_spec(mod_spec)
|
||||
+ mod_spec.loader.exec_module(mod)
|
||||
plugins.append(mod.plugin())
|
||||
except Exception as e:
|
||||
syslog.syslog(syslog.LOG_ERR, "failed to load %s plugin: %s" % (plugin_name, str(e)))
|
||||
|
||||
- if mod_fp:
|
||||
- mod_fp.close()
|
||||
-
|
||||
plugins.sort(key=cmp_to_key(sort_plugins))
|
||||
return plugins
|
||||
|
||||
--
|
||||
2.41.0
|
||||
|
@ -0,0 +1,29 @@
|
||||
From 659f10a0ab422251f4d6857fb34ddf1c25b21b37 Mon Sep 17 00:00:00 2001
|
||||
From: Petr Lautrbach <lautrbach@redhat.com>
|
||||
Date: Wed, 3 May 2023 09:35:28 +0200
|
||||
Subject: [PATCH] Always reset pending alarms when alarm(0)
|
||||
Content-type: text/plain
|
||||
|
||||
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2112573
|
||||
|
||||
Signed-off-by: Petr Lautrbach <lautrbach@redhat.com>
|
||||
---
|
||||
src/setroubleshoot/server.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/setroubleshoot/server.py b/src/setroubleshoot/server.py
|
||||
index fd89a5448912..2b1b0b1c30d0 100755
|
||||
--- a/src/setroubleshoot/server.py
|
||||
+++ b/src/setroubleshoot/server.py
|
||||
@@ -703,7 +703,7 @@ Deletes an alert from the database.
|
||||
return ""
|
||||
|
||||
def alarm(self, timeout=10):
|
||||
- if self.conn_ctr == 0:
|
||||
+ if self.conn_ctr == 0 or timeout == 0:
|
||||
signal.alarm(timeout)
|
||||
|
||||
|
||||
--
|
||||
2.41.0
|
||||
|
Loading…
Reference in new issue