summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Waldon <brian.waldon@rackspace.com>2011-09-23 16:39:21 -0400
committerBrian Waldon <brian.waldon@rackspace.com>2011-09-23 16:40:33 -0400
commitddb6945e8fbb8a00d5b67a6a6b8a069b7642022d (patch)
treebcf32f599cff5c9bea8baa9d805905e0f529c2bb
parent4e94ec1a0a566b66f09b734e6ffe964b4b3b4bee (diff)
Fixing bug 857712
Change-Id: I495363b44d9da96d66f85c2a621393329830aeb3
-rw-r--r--nova/compute/api.py4
-rw-r--r--nova/tests/test_compute.py3
2 files changed, 4 insertions, 3 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py
index 54c847a0a..cfde9cd2f 100644
--- a/nova/compute/api.py
+++ b/nova/compute/api.py
@@ -219,9 +219,9 @@ class API(base.Base):
image_href)
image = image_service.show(context, image_id)
- if instance_type['memory_mb'] < int(image.get('min_ram', 0)):
+ if instance_type['memory_mb'] < int(image.get('min_ram') or 0):
raise exception.InstanceTypeMemoryTooSmall()
- if instance_type['local_gb'] < int(image.get('min_disk', 0)):
+ if instance_type['local_gb'] < int(image.get('min_disk') or 0):
raise exception.InstanceTypeDiskTooSmall()
config_drive_id = None
diff --git a/nova/tests/test_compute.py b/nova/tests/test_compute.py
index 2af0a6012..86ffc18a6 100644
--- a/nova/tests/test_compute.py
+++ b/nova/tests/test_compute.py
@@ -76,7 +76,8 @@ class ComputeTestCase(test.TestCase):
test_notifier.NOTIFICATIONS = []
def fake_show(meh, context, id):
- return {'id': 1, 'properties': {'kernel_id': 1, 'ramdisk_id': 1}}
+ return {'id': 1, 'min_disk': None, 'min_ram': None,
+ 'properties': {'kernel_id': 1, 'ramdisk_id': 1}}
self.stubs.Set(fake_image._FakeImageService, 'show', fake_show)