From 16d72cd3b7904e5138621d829a27171048f91518 Mon Sep 17 00:00:00 2001 From: zhurong Date: Tue, 31 May 2016 03:34:24 -0400 Subject: [PATCH] Fix heat TemplateForm glance.image sizeformat error Now the heat TemplateForm format image size use the diskgbformat, Fix it use filesizeformat. Change-Id: I382915f3300e1d0fc1a57976f3e89e1ece289ca1 Closes-Bug: #1587286 --- openstack_dashboard/dashboards/project/images/utils.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/openstack_dashboard/dashboards/project/images/utils.py b/openstack_dashboard/dashboards/project/images/utils.py index bb4fd45c6..63760f066 100644 --- a/openstack_dashboard/dashboards/project/images/utils.py +++ b/openstack_dashboard/dashboards/project/images/utils.py @@ -10,10 +10,10 @@ # License for the specific language governing permissions and limitations # under the License. +from django.template.defaultfilters import filesizeformat from django.utils.translation import ugettext_lazy as _ from horizon import exceptions -from horizon.templatetags import sizeformat from openstack_dashboard.api import glance @@ -98,8 +98,7 @@ def image_field_data(request, include_empty_option=False): images.sort(key=lambda c: c.name) images_list = [('', _('Select Image'))] for image in images: - image_label = u"{} ({})".format(image.name, - sizeformat.diskgbformat(image.size)) + image_label = u"{} ({})".format(image.name, filesizeformat(image.size)) images_list.append((image.id, image_label)) if not images: