diff options
author | Jenkins <jenkins@review.openstack.org> | 2013-06-17 17:04:50 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2013-06-17 17:04:50 +0000 |
commit | ef317edb704deb0c19660525e6f9690d8ebb79c5 (patch) | |
tree | f6ba1f79f5226e7a62ade546b3a08f6cfdb5e23b | |
parent | 328b347cd058f1c87d7e32a18d9decc0ba517266 (diff) | |
parent | 50680eee2f9842eaca5491e740f1715a2bd32f90 (diff) | |
download | nova-ef317edb704deb0c19660525e6f9690d8ebb79c5.tar.gz nova-ef317edb704deb0c19660525e6f9690d8ebb79c5.tar.xz nova-ef317edb704deb0c19660525e6f9690d8ebb79c5.zip |
Merge "Remove redundant architecture property update in powervm snapshot"
-rw-r--r-- | nova/tests/virt/powervm/test_powervm.py | 13 | ||||
-rwxr-xr-x | nova/virt/powervm/driver.py | 6 |
2 files changed, 12 insertions, 7 deletions
diff --git a/nova/tests/virt/powervm/test_powervm.py b/nova/tests/virt/powervm/test_powervm.py index 8fe08bdb8..6628c23ea 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, diff --git a/nova/virt/powervm/driver.py b/nova/virt/powervm/driver.py index 5ec5a505f..c2cee276d 100755 --- a/nova/virt/powervm/driver.py +++ b/nova/virt/powervm/driver.py @@ -1,6 +1,6 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright 2012 IBM Corp. +# Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain @@ -162,10 +162,6 @@ class PowerVMDriver(driver.ComputeDriver): 'container_format': image_meta['container_format'] } - if 'architecture' in image_meta['properties']: - arch = image_meta['properties']['architecture'] - new_snapshot_meta['properties']['architecture'] = arch - # disk capture and glance upload self._powervm.capture_image(context, instance, image_id, new_snapshot_meta, update_task_state) |