Blame SOURCES/sos-bz2079187-honor-default-plugin-timeout.patch

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