From 50680eee2f9842eaca5491e740f1715a2bd32f90 Mon Sep 17 00:00:00 2001 From: Matt Riedemann Date: Tue, 11 Jun 2013 10:32:39 -0700 Subject: Remove redundant architecture property update in powervm snapshot During an instance snapshot if the architecture property is defined in the image it is updated twice in the snapshot image. The snapshot is created with the metadata values from the "instance_system_metadata" table and then, if defined, the architecture property is updated from the value in the base image in that moment. There is no reason to treat this property differently from others. Also, it didn't respect the "non_inheritable_image_properties" option. This change removes the special behavior for the architecture property in the powervm driver during a snapshot. Fixes bug 1189969 Change-Id: I05ebcaef7b75387827917b5b223868794d98e0aa --- nova/tests/virt/powervm/test_powervm.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'nova/tests') diff --git a/nova/tests/virt/powervm/test_powervm.py b/nova/tests/virt/powervm/test_powervm.py index 3781c6738..181cdee3e 100644 --- a/nova/tests/virt/powervm/test_powervm.py +++ b/nova/tests/virt/powervm/test_powervm.py @@ -269,9 +269,12 @@ class PowerVMDriverTestCase(test.TestCase): self._loc_expected_task_state = expected_state loc_context = context.get_admin_context() + arch = 'fake_arch' properties = {'instance_id': self.instance['id'], - 'user_id': str(loc_context.user_id)} - sent_meta = {'name': 'fake_snap', 'is_public': False, + 'user_id': str(loc_context.user_id), + 'architecture': arch} + snapshot_name = 'fake_snap' + sent_meta = {'name': snapshot_name, 'is_public': False, 'status': 'creating', 'properties': properties} image_service = fake.FakeImageService() recv_meta = image_service.create(loc_context, sent_meta) @@ -283,6 +286,12 @@ class PowerVMDriverTestCase(test.TestCase): self.assertTrue(self._loc_task_state == task_states.IMAGE_UPLOADING and self._loc_expected_task_state == task_states.IMAGE_PENDING_UPLOAD) + snapshot = image_service.show(context, recv_meta['id']) + self.assertEquals(snapshot['properties']['image_state'], 'available') + self.assertEquals(snapshot['properties']['architecture'], arch) + self.assertEquals(snapshot['status'], 'active') + self.assertEquals(snapshot['name'], snapshot_name) + def _set_get_info_stub(self, state): def fake_get_instance(instance_name): return {'state': state, -- cgit