[Heat] Fix default values displaying for "Launch Stack"

This patch set fixes default values displaying for JSON parameters
to make it possible to use them without any changes.

Closes-Bug: #1438138

Change-Id: Ib925dc39320f7cab240eed3ccbcf1fa574bc5507
This commit is contained in:
Tatiana Ovchinnikova 2015-03-30 13:30:17 +03:00
parent d720ab0974
commit eeba3b4b57
2 changed files with 5 additions and 1 deletions

View File

@ -327,6 +327,10 @@ class CreateStackForm(forms.SelfHandlingForm):
field_args['choices'] = choices
field = forms.ChoiceField(**field_args)
elif param_type == 'Json' and 'Default' in param:
field_args['initial'] = json.dumps(param['Default'])
field = forms.CharField(**field_args)
elif param_type in ('CommaDelimitedList', 'String', 'Json'):
if 'MinLength' in param:
field_args['min_length'] = int(param['MinLength'])

View File

@ -60,7 +60,7 @@ downloadcache = ~/cache/pip
exclude = .venv,.git,.tox,dist,*openstack/common*,*lib/python*,*egg,build,panel_template,dash_template,local_settings.py,*/local/*,*/test/test_plugins/*,.ropeproject
# H405 multi line docstring summary not separated with an empty line
ignore = H405
max-complexity = 19
max-complexity = 20
[hacking]
import_exceptions = collections.defaultdict,