This is a deconfig variant of the _configure_dev_attribute() method.
The method restores the original value of a Device attribute based on
the value stored by the _configure_dev_attribute() method.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
lnst/Recipes/ENRT/ConfigMixins/BaseHWConfigMixin.py | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/lnst/Recipes/ENRT/ConfigMixins/BaseHWConfigMixin.py
b/lnst/Recipes/ENRT/ConfigMixins/BaseHWConfigMixin.py
index 29854ee6..c860291c 100644
--- a/lnst/Recipes/ENRT/ConfigMixins/BaseHWConfigMixin.py
+++ b/lnst/Recipes/ENRT/ConfigMixins/BaseHWConfigMixin.py
@@ -17,6 +17,19 @@ class BaseHWConfigMixin(object):
setattr(dev, attr_name, value)
attr_cfg[dev]["configured"] = getattr(dev, attr_name)
+ def _deconfigure_dev_attribute(self, config, dev_list, attr_name):
+ hw_config = config.hw_config
+
+ try:
+ attr_cfg = hw_config[attr_name + "_configuration"]
+ except KeyError:
+ return
+
+ for dev in dev_list:
+ value = attr_cfg[dev]["original"]
+ setattr(dev, attr_name, value)
+ del attr_cfg[dev]
+
def _describe_dev_attribute(self, config, attr_name):
hw_config = config.hw_config
res = []
--
2.21.1