diff options
author | Scott Moser <smoser@brickies.net> | 2012-10-23 18:58:32 +0200 |
---|---|---|
committer | Scott Moser <smoser@brickies.net> | 2012-10-23 18:58:32 +0200 |
commit | 71b4108d029fff61ff8183ffbd77917569bea2cd (patch) | |
tree | 6564cd3f5faa26fb1c843b14d27ca6eaa23164f0 /cloudinit/distros | |
parent | cb5893c3e3f635de4fef86f0a19be0ada0054930 (diff) | |
parent | e8a10a41d22876d555084def823817337d9c2a80 (diff) | |
download | vyos-cloud-init-71b4108d029fff61ff8183ffbd77917569bea2cd.tar.gz vyos-cloud-init-71b4108d029fff61ff8183ffbd77917569bea2cd.zip |
use only util methods for reading/loading/appending/peeking
Use only util methods for reading/loading/appending/peeking
at files since it is likely soon that we will add a new
way of adjusting the root of files read, also it is useful
for debugging to track what is being read/written in a central
fashion.
Diffstat (limited to 'cloudinit/distros')
-rw-r--r-- | cloudinit/distros/__init__.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/cloudinit/distros/__init__.py b/cloudinit/distros/__init__.py index 11a72da1..2fbb0e9b 100644 --- a/cloudinit/distros/__init__.py +++ b/cloudinit/distros/__init__.py @@ -335,8 +335,7 @@ class Distro(object): util.write_file(sudo_file, content, 0440) else: try: - with open(sudo_file, 'a') as f: - f.write(content) + util.append_file(sudo_file, content) except IOError as e: util.logexc(LOG, "Failed to write %s" % sudo_file, e) raise e |