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

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