From c42c0f2c88242d0093b596f34978afe62ec015db Mon Sep 17 00:00:00 2001 From: Victor Sergeyev Date: Wed, 23 Apr 2014 13:47:18 +0300 Subject: [PATCH] Replace Integer to Number in Type check There is no Integer type in Heat template, so we should use Number instead. See Heat parameters documentation http://docs.openstack.org/developer/heat/template_guide/hot_spec.html#hot-spec-parameters IntegerField replaced to FloatField, because Number can store floating point values too. Add Type to ValueError message Change-Id: I74935c7c04cdd980ecc540f14baffbb4d115908c --- .../overcloud/workflows/undeployed_configuration.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tuskar_ui/infrastructure/overcloud/workflows/undeployed_configuration.py b/tuskar_ui/infrastructure/overcloud/workflows/undeployed_configuration.py index 4dd4d08c5..2ec1ed4f0 100644 --- a/tuskar_ui/infrastructure/overcloud/workflows/undeployed_configuration.py +++ b/tuskar_ui/infrastructure/overcloud/workflows/undeployed_configuration.py @@ -31,10 +31,11 @@ def make_field(name, Type, NoEcho, Default, Description, AllowedValues=None, attrs['placeholder'] = _("auto-generate") if Type == 'String': Field = django.forms.CharField - elif Type == 'Integer': - Field = django.forms.IntegerField + elif Type == 'Number': + Field = django.forms.FloatField else: - raise ValueError("Unsupported parameter type in Heat template.") + raise ValueError( + "Unsupported parameter type %r in Heat template." % Type) if NoEcho == 'true': Widget = django.forms.PasswordInput widget_kwargs['render_value'] = True