commit 58c9c3f238e71c69b5b4a760c47a1788cd657ea9
Author: Stephen Finucane <email address hidden>
Date: Thu May 21 14:43:25 2020 +0100
hardware: Raise useful error for invalid mempage size
The 'hw:mem_page_size' extra spec allows you to specify values in three
ways: via a relative size alias (large, small, any), via exact byte
values, and via an SI/IEC/mixed representation (e.g. 2MB, 1GB).
Currently, attempting to use an invalid variant of the latter, such as
'2M', will raise a rather confusing error message:
Invalid memory page size '0'
Correct this so we instead see something like so:
Invalid memory page size '2M'
Changes: nova/virt/hardware.py
NOTE(stephenfin): We need to drop use of 'raise...from', which is Python
3-only syntax. The net effect of this change is uglier (but still valid)
tracebacks.
Change-Id: I3af99f03514904da09f7b71f430b43bf75e8be67
Signed-off-by: Stephen Finucane <email address hidden>
Closes-Bug: #1879964
(cherry picked from commit f76d09b19d5b7530b7e4e9fc255835f6aff5db6a)
(cherry picked from commit eedc0b5ff319b3cce42dba4c4720bcb98798e064)
Reviewed: https:/ /review. opendev. org/735950 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=58c9c3f238e 71c69b5b4a760c4 7a1788cd657ea9
Committed: https:/
Submitter: Zuul
Branch: stable/train
commit 58c9c3f238e71c6 9b5b4a760c47a17 88cd657ea9
Author: Stephen Finucane <email address hidden>
Date: Thu May 21 14:43:25 2020 +0100
hardware: Raise useful error for invalid mempage size
The 'hw:mem_page_size' extra spec allows you to specify values in three
ways: via a relative size alias (large, small, any), via exact byte
values, and via an SI/IEC/mixed representation (e.g. 2MB, 1GB).
Currently, attempting to use an invalid variant of the latter, such as
'2M', will raise a rather confusing error message:
Invalid memory page size '0'
Correct this so we instead see something like so:
Invalid memory page size '2M'
Changes:
nova/ virt/hardware. py
NOTE( stephenfin) : We need to drop use of 'raise...from', which is Python
3-only syntax. The net effect of this change is uglier (but still valid)
tracebacks.
Change-Id: I3af99f03514904 da09f7b71f430b4 3bf75e8be67 0b7e4e9fc255835 f6aff5db6a) ce42dba4c4720bc b98798e064)
Signed-off-by: Stephen Finucane <email address hidden>
Closes-Bug: #1879964
(cherry picked from commit f76d09b19d5b753
(cherry picked from commit eedc0b5ff319b3c