Blame SOURCES/sos-bz2055547-honour-plugins-timeout-hardcoded.patch

203ee3
From 7069e99d1c5c443f96a98a7ed6db67fa14683e67 Mon Sep 17 00:00:00 2001
203ee3
From: Pavel Moravec <pmoravec@redhat.com>
203ee3
Date: Thu, 17 Feb 2022 09:14:15 +0100
203ee3
Subject: [PATCH] [report] Honor plugins' hardcoded plugin_timeout
203ee3
203ee3
Currently, plugin's plugin_timeout hardcoded default is superseded by
203ee3
whatever --plugin-timeout value, even when this option is not used and
203ee3
we eval it to TIMEOUT_DEFAULT.
203ee3
203ee3
In this case of not setting --plugin-timeout either -k plugin.timeout,
203ee3
honour plugin's plugin_timeout instead.
203ee3
203ee3
Resolves: #2863
203ee3
Closes: #2864
203ee3
203ee3
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
203ee3
---
203ee3
 sos/report/plugins/__init__.py | 5 ++++-
203ee3
 1 file changed, 4 insertions(+), 1 deletion(-)
203ee3
203ee3
diff --git a/sos/report/plugins/__init__.py b/sos/report/plugins/__init__.py
203ee3
index cc5cb65b..336b4d22 100644
203ee3
--- a/sos/report/plugins/__init__.py
203ee3
+++ b/sos/report/plugins/__init__.py
203ee3
@@ -636,7 +636,10 @@ class Plugin():
203ee3
             if opt_timeout is None:
203ee3
                 _timeout = own_timeout
203ee3
             elif opt_timeout is not None and own_timeout == -1:
203ee3
-                _timeout = int(opt_timeout)
203ee3
+                if opt_timeout == TIMEOUT_DEFAULT:
203ee3
+                    _timeout = default_timeout
203ee3
+                else:
203ee3
+                    _timeout = int(opt_timeout)
203ee3
             elif opt_timeout is not None and own_timeout > -1:
203ee3
                 _timeout = own_timeout
203ee3
             else:
203ee3
-- 
203ee3
2.34.1
203ee3