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
This commit is contained in:
parent
288a6ee498
commit
c42c0f2c88
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user