summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAija Jaunteva <aija.jaunteva@dell.com>2020-04-20 21:33:36 +0300
committerAija Jaunteva <aija.jaunteva@dell.com>2020-04-21 18:46:16 +0000
commit234306acbbdb89f8e097ceab75ee026f79acd48e (patch)
tree3992ba3ac8de5122b9a346eb77e79f4571442a97
parentba882e723867f2d33e1701413832ea5a23b9458f (diff)
downloadironic-234306acbbdb89f8e097ceab75ee026f79acd48e.tar.gz
Fix SpanLength calculation for DRAC RAID configuration
Caused by differences in number division in Python 2 and Python 3, so forcing type to be int instead of float as expected by idrac. Change-Id: I6a20ec52a8c464aaf275583fb21607fffb3b1f3b Story: 2004265 Task: 27804 (cherry picked from commit 27a0b54b6c5d5af19a3888a5d3348cac4ba9ffb0)
-rw-r--r--ironic/drivers/modules/drac/raid.py2
-rw-r--r--releasenotes/notes/bug-2004265-cd9056868295f374.yaml7
2 files changed, 8 insertions, 1 deletions
diff --git a/ironic/drivers/modules/drac/raid.py b/ironic/drivers/modules/drac/raid.py
index f90948e05..bd2a3f5ac 100644
--- a/ironic/drivers/modules/drac/raid.py
+++ b/ironic/drivers/modules/drac/raid.py
@@ -495,7 +495,7 @@ def _calculate_volume_props(logical_disk, physical_disks, free_space_mb):
error_msg = _('invalid number of physical disks was provided')
raise exception.DracOperationError(error=error_msg)
- disks_per_span = len(selected_disks) / spans_count
+ disks_per_span = int(len(selected_disks) / spans_count)
# Best practice is to not pass span_length and span_depth when creating a
# RAID10. The iDRAC will dynamically calculate these values using maximum
diff --git a/releasenotes/notes/bug-2004265-cd9056868295f374.yaml b/releasenotes/notes/bug-2004265-cd9056868295f374.yaml
new file mode 100644
index 000000000..5d25b5ea8
--- /dev/null
+++ b/releasenotes/notes/bug-2004265-cd9056868295f374.yaml
@@ -0,0 +1,7 @@
+---
+fixes:
+ - |
+ Fixes 'Invalid parameter value for SpanLength' when configuring RAID
+ using Python 3. This passed incorrect data type to iDRAC, e.g., instead
+ of `2` it passed `2.0`.
+ See `story 2004265 <https://storyboard.openstack.org/#!/story/2004265>`_.