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

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