If a specific config mixin's dev_list property is left unset, the
mixin's description
would be silently discarded. In such cases the mixin should report that configuration
of the feature has been skipped. That should be similar to the case when the parameter
controlling the mixin is not specified.
Fixes issue 199
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
lnst/Recipes/ENRT/ConfigMixins/BaseHWConfigMixin.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lnst/Recipes/ENRT/ConfigMixins/BaseHWConfigMixin.py
b/lnst/Recipes/ENRT/ConfigMixins/BaseHWConfigMixin.py
index c860291c..6fce028d 100644
--- a/lnst/Recipes/ENRT/ConfigMixins/BaseHWConfigMixin.py
+++ b/lnst/Recipes/ENRT/ConfigMixins/BaseHWConfigMixin.py
@@ -10,7 +10,9 @@ class BaseHWConfigMixin(object):
def _configure_dev_attribute(self, config, dev_list, attr_name, value):
hw_config = config.hw_config
- attr_cfg = hw_config[attr_name + "_configuration"] = {}
+ if len(dev_list) > 0:
+ attr_cfg = hw_config[attr_name + "_configuration"] = {}
+
for dev in dev_list:
attr_cfg[dev] = {}
attr_cfg[dev]["original"] = getattr(dev, attr_name)
--
2.21.3
_______________________________________________
LNST-developers mailing list -- lnst-developers(a)lists.fedorahosted.org
To unsubscribe send an email to lnst-developers-leave(a)lists.fedorahosted.org
Fedora Code of Conduct:
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines:
https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives:
https://lists.fedorahosted.org/archives/list/lnst-developers@lists.fedora...