Keep all image metadata during image mark up

Before, all image metadata was lost
after marking image with Murano data.

Change-Id: If68c91015f4512a53f5f5b7b49355a4f62f44309
Closes-Bug: #1385717
(cherry picked from commit 9f757225c1)
This commit is contained in:
Ekaterina Chernova 2014-11-05 15:53:02 +04:00 committed by Serg Melikyan
parent 8f07015595
commit 23fb53d405
2 changed files with 7 additions and 7 deletions

View File

@ -78,12 +78,11 @@ class MarkImageForm(horizon_forms.SelfHandlingForm):
LOG.debug('Marking image with specified metadata: {0}'.format(data))
image_id = data['image']
properties = {
'murano_image_info': json.dumps({
'title': data['title'],
'type': data['type']
})
}
properties = glance.image_get(request, image_id).properties
properties['murano_image_info'] = json.dumps({
'title': data['title'],
'type': data['type']
})
try:
img = glance.image_update(request, image_id, properties=properties)

View File

@ -35,7 +35,8 @@ class RemoveImageMetadata(tables.DeleteAction):
def delete(self, request, obj_id):
try:
glance.image_update(request, obj_id, purge_props=True)
glance.image_update(request, obj_id,
purge_props='murano_image_info')
except Exception:
exceptions.handle(request, _('Unable to remove metadata'),
redirect='horizon:murano:images:index')