Share snapshot image membership with instance owner

Stop overwriting the is_public image metadata field so that nova
can handle this. For more information, see [1].

[1] http://lists.openstack.org/pipermail/openstack-discuss/2019-January/001726.html

Change-Id: If5c08dd28b61de8fad66d3ba9ec858aaa2fa8287
Depends-On: https://review.openstack.org/630769
Closes-Bug: #1675791
This commit is contained in:
Matthew Edmonds 2019-01-16 10:04:23 -05:00
parent 2000340c4a
commit 5a342bd309
2 changed files with 1 additions and 2 deletions

View File

@ -51,7 +51,6 @@ class TestImage(test.NoDBTestCase):
mock_api.get.assert_called_with('context', 'image_id')
self.assertEqual({
'name': 'image_name',
'is_public': False,
'status': 'active',
'disk_format': 'raw',
'container_format': 'bare',

View File

@ -56,10 +56,10 @@ def generate_snapshot_metadata(context, image_api, image_id, instance):
:param instance: The Nova instance whose disk is to be snapshotted.
:return: A dict of metadata suitable for image_api.update.
"""
# TODO(esberglu): Update this to v2 metadata
image = image_api.get(context, image_id)
metadata = {
'name': image['name'],
'is_public': False,
'status': 'active',
'disk_format': 'raw',
'container_format': 'bare',