Comment 6 for bug 1879964

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/train)

Reviewed: https://review.opendev.org/735950
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=58c9c3f238e71c69b5b4a760c47a1788cd657ea9
Submitter: Zuul
Branch: stable/train

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)