If a template substitution fails, the appserver crashes
Bug #1227035 reported by
Julian Edwards
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Released
|
Critical
|
Julian Edwards |
Bug Description
You are presented with a nice "Internal server error." page.
To recreate, change something like preseed_master to have an invalid variable, and preview the preseed in the node page.
Related branches
lp:~julian-edwards/maas/preseed-render-crash-bug-1227035
- Jeroen T. Vermeulen (community): Approve
-
Diff: 81 lines (+28/-2)2 files modifiedsrc/maasserver/tests/test_views_nodes.py (+18/-0)
src/maasserver/views/nodes.py (+10/-2)
Changed in maas: | |
status: | New → Triaged |
importance: | Undecided → Critical |
milestone: | none → 13.10 |
tags: | added: appserver |
description: | updated |
Changed in maas: | |
status: | Triaged → In Progress |
Changed in maas: | |
milestone: | 13.10 → 14.04 |
Changed in maas: | |
status: | In Progress → Triaged |
Changed in maas: | |
assignee: | nobody → Julian Edwards (julian-edwards) |
status: | Triaged → In Progress |
Changed in maas: | |
status: | In Progress → Fix Committed |
Changed in maas: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Gavin suggested that we need to handle yaml escaping properly in templates:
-----
We could/ought to add the following escape function to the templates:
from StringIO import StringIO
import yaml
def quote_yaml(thing): (buf, encoding=None)
dumper. open()
dumper. write_double_ quoted( string)
dumper. represent( thing)
dumper. close()
dumper. dispose( )
buf = StringIO()
dumper = yaml.SafeDumper
try:
if isinstance(thing, unicode):
# Force double-quote style for unicode strings.
else:
finally:
return buf.getvalue()