summaryrefslogtreecommitdiff
path: root/cloudinit/distros/ubuntu.py
diff options
context:
space:
mode:
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):