Better magic for write_file
Bug #1195634 reported by
Stuart Bishop
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Charm Helpers |
Fix Released
|
Medium
|
Stuart Bishop |
Bug Description
Currently, write_file implicitly runs format in the path and the file contents. This can be useful, but can also cause great pain if the contents contains curly braces, common in many of the files we need to store like Perl or JSON or Ruby.
I propose moving the implicit format out of this helper (and others for consistency), and switching to the following syntax:
write_file(
Related branches
lp:~stub/charm-helpers/bug-1195649-fix-write-file
- Matthew Wedgwood (community): Approve
-
Diff: 203 lines (+68/-67)4 files modifiedcharmhelpers/contrib/templating/pyformat.py (+13/-0)
charmhelpers/core/host.py (+6/-19)
tests/contrib/templating/test_pyformat.py (+36/-0)
tests/core/test_host.py (+13/-48)
Changed in charm-helpers: | |
status: | New → In Progress |
assignee: | nobody → Stuart Bishop (stub) |
Changed in charm-helpers: | |
importance: | Undecided → Medium |
status: | In Progress → Fix Committed |
status: | Fix Committed → Fix Released |
To post a comment you must log in.