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
This commit is contained in:
parent
dcb91e3b55
commit
9f757225c1
|
@ -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)
|
||||
|
|
|
@ -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')
|
||||
|
|
Loading…
Reference in New Issue