do not write a comment in /etc/hostname.

Network Manager (LP: #1053048), and apparently fedora/redhat do not like
comments in this file.
This commit is contained in:
Scott Moser 2012-09-19 15:07:03 -04:00
parent b1dabc79a9
commit 3535558137

View File

@ -67,8 +67,7 @@ class Distro(distros.Distro):
def _write_hostname(self, hostname, out_fn):
# "" gives trailing newline.
lines = ["# Created by cloud-init", str(hostname), ""]
util.write_file(out_fn, '\n'.join(lines), 0644)
util.write_file(out_fn, "%s\n" % str(hostname), 0644)
def update_hostname(self, hostname, prev_fn):
hostname_prev = self._read_hostname(prev_fn)