From 8c0ce28c35b0f4766ccd188701a5f3d96f3f9a07 Mon Sep 17 00:00:00 2001 From: zhurong Date: Sun, 19 Jun 2016 08:42:57 -0400 Subject: [PATCH] Mark image form filter out the 'aki' and 'ari' format AKI and ARI type can not launch instance. Launch instance filter: https://github.com/openstack/horizon/blob/master/openstack_dashboard/dashboards/project/images/utils.py#L78 Image table filter: https://github.com/openstack/horizon/blob/master/openstack_dashboard/dashboards/project/images/images/tables.py#L30 So filter out the 'aki' and 'ari' image format for the mark image form. Change-Id: Ib5f85d4e8bf2ef1a5e6f44802d93b8c096ee5241 Closes-bug: #1594112 --- muranodashboard/images/forms.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/muranodashboard/images/forms.py b/muranodashboard/images/forms.py index dae981345..ec33375fd 100644 --- a/muranodashboard/images/forms.py +++ b/muranodashboard/images/forms.py @@ -71,6 +71,10 @@ class MarkImageForm(horizon_forms.SelfHandlingForm): LOG.error('Failed to request image list from Glance') exceptions.handle(request, _('Unable to retrieve list of images')) + # filter out the image format aki and ari + images = filter( + lambda x: x.container_format not in ('aki', 'ari'), images) + self.fields['image'].choices = [(i.id, i.name) for i in images] self.fields['existing_titles'].initial = \ [image.title for image in filter_murano_images(images)]