summaryrefslogtreecommitdiff
path: root/cloudinit/config/cc_write_files.py
AgeCommit message (Collapse)Author
2018-12-06write_files: add support for appending to files.James Baxter
Add 'append: true' to write_files entries to append 'content' to file specified by 'path' key. This modifies the file open mode to append.
2018-07-09docs: note in rtd about avoiding /tmp when writing filesChad Smith
LP: #1727876
2018-06-28docs: Fix a small spelling error.Oz N Tiram
standargs -> standards.
2017-07-11write_files: Remove log from helper function signatures.Andrew Jorgensen
Instead of passing around a 'log' reference to functions, just import logging and use that. This is the pattern that is now more common in cloud-init.
2017-06-15write_file(s): Print permissions as octal, not decimalAndrew Jorgensen
Unix file modes are usually represented as octal, but they were being interpreted as decimal, for example 0o644 would be printed as '420'. Reviewed-by: Tom Kirchner <tjk@amazon.com>
2016-12-22LICENSE: Allow dual licensing GPL-3 or Apache 2.0Jon Grimm
This has been a recurring ask and we had initially just made the change to the cloud-init 2.0 codebase. As the current thinking is we'll just continue to enhance the current codebase, its desirable to relicense to match what we'd intended as part of the 2.0 plan here. - put a brief description of license in LICENSE file - put full license versions in LICENSE-GPLv3 and LICENSE-Apache2.0 - simplify the per-file header to reference LICENSE - tox: ignore H102 (Apache License Header check) Add license header to files that ship. Reformat headers, make sure everything has vi: at end of file. Non-shipping files do not need the copyright header, but at the moment tests/ have it.
2016-09-30Improve module documentation and doc cleanup.Wesley Wiedenmeier
This adds lots of config module documentation in a standard format. It will greatly improve the content at readthedocs. Additionally: * Add a 'doc' env to tox.ini * Changed default highlight language for sphinx conf from python to yaml most examples in documentation are yaml configs * Updated datasource examples to highlight sh code properly
2016-06-21write_files: if no permissions are given, just use default without warn.Scott Moser
if no permissions were given in a write_files stanza, then a warning would be emitted. The fix here is just to special case handling of None.
2016-04-05write_files: fix decompression of contentScott Moser
When provided with gzipped data, an exception would be raised because of a conversion to string. This fixes the issue and adds a test for write_files. LP: #1565638
2015-01-26More Python 3 test fixes.Barry Warsaw
2012-08-22fix pep8 complaints.Scott Moser
make pep8 now is silent on precise's pep8 ( 0.6.1-2ubuntu2).
2012-07-11add write-files module for "injecting" files (LP: #1012854)Scott Moser
This implements file writing via cloud-config. It also * adjusts other code to have user/group parsing in util instead of in stages.py, * renames decomp_str to decomp_gzip since it is more meaningful when named that (as thats all it can decompress). LP: #1012854
2012-07-11Update the write files with the new content/compression handling.Joshua Harlow
Adjust the examples file to reflect this.
2012-07-11Fix log message after 'write_files' key change.Joshua Harlow
2012-07-11Adjust the decoding of the files that are given so that a canonicalizeJoshua Harlow
happens first, which will examine the incoming encoding, and decide the neccasary decoding types needed to get the final resultant string and then use these normalized decoding types to actually do the final decode. Also change the name of the config key that is looked up to 'write_files' since 'files' is pretty generic and could have clashes with other modules. Add an example that shows how to use this in the different encoding formats that are supported.
2012-07-10Fixes 1012854 by implementing file writing, adjustsJoshua Harlow
other code to have user/group parsing in util instead of in stages.py, renames decomp_str to decomp_gzip since it is more meaningful when named that (as thats all it can decompress).