diff --git a/nova/tests/unit/virt/hyperv/test_snapshotops.py b/nova/tests/unit/virt/hyperv/test_snapshotops.py index c5d0fc0b692a..d95006cb79fe 100644 --- a/nova/tests/unit/virt/hyperv/test_snapshotops.py +++ b/nova/tests/unit/virt/hyperv/test_snapshotops.py @@ -41,8 +41,7 @@ class SnapshotOpsTestCase(test_base.HyperVBaseTestCase): def test_save_glance_image(self, mock_get_remote_image_service): image_metadata = {"is_public": False, "disk_format": "vhd", - "container_format": "bare", - "properties": {}} + "container_format": "bare"} glance_image_service = mock.MagicMock() mock_get_remote_image_service.return_value = (glance_image_service, mock.sentinel.IMAGE_ID) @@ -55,7 +54,8 @@ class SnapshotOpsTestCase(test_base.HyperVBaseTestCase): mock.sentinel.PATH, 'rb') glance_image_service.update.assert_called_once_with( self.context, mock.sentinel.IMAGE_ID, image_metadata, - self._snapshotops._pathutils.open().__enter__()) + self._snapshotops._pathutils.open().__enter__(), + purge_props=False) @mock.patch('nova.virt.hyperv.snapshotops.SnapshotOps._save_glance_image') def _test_snapshot(self, mock_save_glance_image, base_disk_path): diff --git a/nova/virt/hyperv/snapshotops.py b/nova/virt/hyperv/snapshotops.py index d453362a451b..4a7629457223 100644 --- a/nova/virt/hyperv/snapshotops.py +++ b/nova/virt/hyperv/snapshotops.py @@ -43,10 +43,10 @@ class SnapshotOps(object): image_id) = glance.get_remote_image_service(context, image_id) image_metadata = {"is_public": False, "disk_format": "vhd", - "container_format": "bare", - "properties": {}} + "container_format": "bare"} with self._pathutils.open(image_vhd_path, 'rb') as f: - glance_image_service.update(context, image_id, image_metadata, f) + glance_image_service.update(context, image_id, image_metadata, f, + purge_props=False) def snapshot(self, context, instance, image_id, update_task_state): # While the snapshot operation is not synchronized within the manager,