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
This commit is contained in:
Aija Jaunteva 2020-04-20 21:33:36 +03:00 committed by Julia Kreger
parent 698861c641
commit 41ef959eb1
2 changed files with 8 additions and 1 deletions

View File

@ -614,7 +614,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

View File

@ -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>`_.