summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--nova/compute/api.py4
-rw-r--r--nova/tests/compute/test_compute.py6
2 files changed, 5 insertions, 5 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py
index 103489805..25987d766 100644
--- a/nova/compute/api.py
+++ b/nova/compute/api.py
@@ -1647,13 +1647,13 @@ class API(base.Base):
#disk format of vhd is non-shrinkable
if orig_image.get('disk_format') == 'vhd':
- min_ram = instance['instance_type']['memory_mb']
min_disk = instance['instance_type']['root_gb']
else:
#set new image values to the original image values
- min_ram = orig_image.get('min_ram')
min_disk = orig_image.get('min_disk')
+ min_ram = orig_image.get('min_ram')
+
return min_ram, min_disk
def _get_block_device_info(self, context, instance_uuid):
diff --git a/nova/tests/compute/test_compute.py b/nova/tests/compute/test_compute.py
index 98eba5570..d375c036e 100644
--- a/nova/tests/compute/test_compute.py
+++ b/nova/tests/compute/test_compute.py
@@ -4663,8 +4663,8 @@ class ComputeAPITestCase(BaseTestCase):
def test_snapshot_minram_mindisk_VHD(self):
"""Ensure a snapshots min_ram and min_disk are correct.
- A snapshot of a non-shrinkable VHD should have min_ram
- and min_disk set to that of the original instances flavor.
+ A snapshot of a non-shrinkable VHD should have min_disk
+ set to that of the original instances flavor.
"""
self.fake_image.update(disk_format='vhd',
@@ -4678,7 +4678,7 @@ class ComputeAPITestCase(BaseTestCase):
self.assertEqual(image['name'], 'snap1')
instance_type = instance['instance_type']
- self.assertEqual(image['min_ram'], instance_type['memory_mb'])
+ self.assertEqual(image['min_ram'], self.fake_image['min_ram'])
self.assertEqual(image['min_disk'], instance_type['root_gb'])
properties = image['properties']
self.assertTrue('backup_type' not in properties)