summaryrefslogtreecommitdiff
path: root/cloudinit/distros/ubuntu.py
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2012-06-18 17:25:10 -0700
committerJoshua Harlow <harlowja@yahoo-inc.com>2012-06-18 17:25:10 -0700
commit24b818fd7c26ccc4c31191c1ae274a5fff506038 (patch)
treeca27d2bd7bada5d001f6ebe6ba7789944dfadc87 /cloudinit/distros/ubuntu.py
parent1d6c6b6a97ca06f0044e7a3987d76519b4feee9e (diff)
downloadvyos-cloud-init-24b818fd7c26ccc4c31191c1ae274a5fff506038.tar.gz
vyos-cloud-init-24b818fd7c26ccc4c31191c1ae274a5fff506038.zip
Add created by or added by cloud-init lines when we modify or create files.
Diffstat (limited to 'cloudinit/distros/ubuntu.py')
-rw-r--r--cloudinit/distros/ubuntu.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/cloudinit/distros/ubuntu.py b/cloudinit/distros/ubuntu.py
index c0345c1d..24724d83 100644
--- a/cloudinit/distros/ubuntu.py
+++ b/cloudinit/distros/ubuntu.py
@@ -54,7 +54,10 @@ class Distro(distros.Distro):
util.subp(['hostname', hostname])
def _write_hostname(self, hostname, out_fn):
- contents = "%s\n" % (hostname)
+ lines = []
+ lines.append("# Created by cloud-init")
+ lines.append(str(hostname))
+ contents = "\n".join(lines)
util.write_file(out_fn, contents, 0644)
def update_hostname(self, hostname, prev_file):