sos/SOURCES/sos-bz1912889-plugopts-igno...

34 lines
1.0 KiB
Diff

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