summaryrefslogtreecommitdiff
path: root/nova/compute/api.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-04-13 17:11:45 +0000
committerGerrit Code Review <review@openstack.org>2016-04-13 17:11:46 +0000
commit6fdf1c87b1149e8b395eaa9f4cbf27263cf96ac6 (patch)
tree24424f5f21981cefd8249c835fb36604dce5bae2 /nova/compute/api.py
parentc8b53644fe3dd76d4c47c65368f39bb45865f1d9 (diff)
parent4817f910bee28ba47abbcb3297bdafe3164de60e (diff)
downloadnova-6fdf1c87b1149e8b395eaa9f4cbf27263cf96ac6.tar.gz
Merge "Return 400 on boot for invalid image metadata" into stable/liberty12.0.3
Diffstat (limited to 'nova/compute/api.py')
-rw-r--r--nova/compute/api.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py
index 32ca41fd73..63a98f37da 100644
--- a/nova/compute/api.py
+++ b/nova/compute/api.py
@@ -937,7 +937,13 @@ class API(base.Base):
block_device.properties_root_device_name(
boot_meta.get('properties', {})))
- image_meta = objects.ImageMeta.from_dict(boot_meta)
+ try:
+ image_meta = objects.ImageMeta.from_dict(boot_meta)
+ except ValueError as e:
+ # there must be invalid values in the image meta properties so
+ # consider this an invalid request
+ msg = _('Invalid image metadata. Error: %s') % six.text_type(e)
+ raise exception.InvalidRequest(msg)
numa_topology = hardware.numa_get_constraints(
instance_type, image_meta)