nova/nova/virt
Stephen Finucane 58c9c3f238 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 <stephenfin@redhat.com>
Closes-Bug: #1879964
(cherry picked from commit f76d09b19d)
(cherry picked from commit eedc0b5ff3)
2020-07-10 11:27:43 +01:00
..
disk [Trivial]Remove unused helper get_allocated_disk_size 2019-08-28 13:36:52 +08:00
hyperv Validate CPU config options against running instances 2019-09-18 00:19:33 +01:00
image libvirt: virtuozzo instance resize support 2016-06-28 22:13:49 +03:00
ironic Lowercase ironic driver hash ring and ignore case in cache 2020-03-18 21:00:22 +00:00
libvirt Guard against missing image cache directory 2020-07-03 12:00:36 +02:00
powervm Validate CPU config options against running instances 2019-09-18 00:19:33 +01:00
vmwareapi Validate CPU config options against running instances 2019-09-18 00:19:33 +01:00
xenapi Validate CPU config options against running instances 2019-09-18 00:19:33 +01:00
zvm Validate CPU config options against running instances 2019-09-18 00:19:33 +01:00
__init__.py Declare nova.virt namespace 2016-04-28 15:01:44 +00:00
arch.py Added ability to configure default architecture for ImagePropertiesFilter 2018-05-14 16:55:13 -04:00
block_device.py block_device: Copy original volume_type when missing for snapshot based volumes 2019-11-29 11:30:43 +00:00
configdrive.py Skip existing VMs when hosts apply force_config_drive 2019-05-22 21:02:16 +00:00
driver.py Unplug VIFs as part of cleanup of networks 2020-03-05 11:21:36 +00:00
event.py Port binding based on events during live migration 2018-07-19 09:09:55 -04:00
fake.py Validate CPU config options against running instances 2019-09-18 00:19:33 +01:00
firewall.py Merge "Remove translation of log messages" 2017-06-20 21:16:49 +00:00
hardware.py hardware: Raise useful error for invalid mempage size 2020-07-10 11:27:43 +01:00
imagecache.py Reserve DISK_GB resource for the image cache 2020-05-25 09:30:55 +02:00
images.py Improve libvirt image and snapshot handling 2019-03-05 12:18:34 -06:00
interfaces.template
netutils.py libvirt: add vf_trusted field for network metadata 2018-05-30 15:11:59 -04:00
osinfo.py Stop sending bad values from libosinfo to libvirt 2019-07-04 15:30:51 +01:00
storage_users.py Remove translation of log messages 2017-06-13 11:20:28 +07:00
virtapi.py Add VirtAPI.update_compute_provider_status 2019-07-02 11:45:40 -04:00