summaryrefslogtreecommitdiff
path: root/ironic/drivers
diff options
context:
space:
mode:
authorRichard Pioso <richard.pioso@dell.com>2016-10-28 20:11:18 -0400
committerRichard Pioso <richard.pioso@dell.com>2016-10-31 15:00:32 -0400
commit6d6cf18f3171f42af1567c65240a7a6a759377c2 (patch)
treec3663ea28f6ee1ff108d8e147f1ae3aa8f544b06 /ironic/drivers
parentf750bcd52124951db1beac95a00572c0548a01a6 (diff)
downloadironic-6d6cf18f3171f42af1567c65240a7a6a759377c2.tar.gz
DRAC get_bios_config() passthru causes exception
The DRAC driver's (pxe_drac) get_bios_config() vendor passthru method raises an AttributeError exception. It no longer returns the current BIOS configuration. This is a regression from stable/mitaka. Triage found that get_bios_config() mistakenly treats the value returned by python-dracclient's list_bios_settings() as containing named tuples. When it calls the namedtuple _asdict() method, an AttributeError exception is raised. Revert get_bios_config()'s handling of the return value to use __dict__. Remove the comment that is not consistent with the implementation. Also revert the unit test case for a successful call to use mock to create the return value. Use mock.NonCallableMock with an empty specification (spec) to catch this type of bug in the future. Change-Id: I94afaa72a1ef25efc1b622e29e3a92a5d27f1892 Closes-Bug: #1637671
Diffstat (limited to 'ironic/drivers')
-rw-r--r--ironic/drivers/modules/drac/vendor_passthru.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/ironic/drivers/modules/drac/vendor_passthru.py b/ironic/drivers/modules/drac/vendor_passthru.py
index 07b08135e..be45ef61c 100644
--- a/ironic/drivers/modules/drac/vendor_passthru.py
+++ b/ironic/drivers/modules/drac/vendor_passthru.py
@@ -65,9 +65,7 @@ class DracVendorPassthru(base.VendorInterface):
"""
bios_attrs = {}
for name, bios_attr in drac_bios.get_config(task.node).items():
- # NOTE(ifarkas): call from python-dracclient returns list of
- # namedtuples, converting it to dict here.
- bios_attrs[name] = bios_attr._asdict()
+ bios_attrs[name] = bios_attr.__dict__
return bios_attrs