Blame SOURCES/sos-bz1912889-plugopts-ignored-in-configfile.patch

62aeb2
From cd56e096afc8ef06c215c45cbf025bda60f0169c Mon Sep 17 00:00:00 2001
62aeb2
From: Pavel Moravec <pmoravec@redhat.com>
62aeb2
Date: Tue, 5 Jan 2021 15:06:24 +0100
62aeb2
Subject: [PATCH] [component] honour plugopts from config file
62aeb2
62aeb2
Currently, config file plugopts are ignored as we overwrite it
62aeb2
in apply_options_from_cmdline by empty list default value from
62aeb2
cmdline.
62aeb2
62aeb2
Resolves: #2359
62aeb2
62aeb2
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
62aeb2
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
62aeb2
---
62aeb2
 sos/component.py | 2 +-
62aeb2
 1 file changed, 1 insertion(+), 1 deletion(-)
62aeb2
62aeb2
diff --git a/sos/component.py b/sos/component.py
62aeb2
index 7774c05a..bd008761 100644
62aeb2
--- a/sos/component.py
62aeb2
+++ b/sos/component.py
62aeb2
@@ -192,7 +192,7 @@ class SoSComponent():
62aeb2
         for opt, val in codict.items():
62aeb2
             if opt not in cmdopts.arg_defaults.keys():
62aeb2
                 continue
62aeb2
-            if val is not None and val != opts.arg_defaults[opt]:
62aeb2
+            if val not in [None, [], ''] and val != opts.arg_defaults[opt]:
62aeb2
                 setattr(opts, opt, val)
62aeb2
 
62aeb2
         return opts
62aeb2
-- 
62aeb2
2.26.2
62aeb2