diff options
Diffstat (limited to 'cloudinit/distros/parsers/hosts.py')
-rw-r--r-- | cloudinit/distros/parsers/hosts.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cloudinit/distros/parsers/hosts.py b/cloudinit/distros/parsers/hosts.py index 5374ab0b..958a7c31 100644 --- a/cloudinit/distros/parsers/hosts.py +++ b/cloudinit/distros/parsers/hosts.py @@ -23,6 +23,7 @@ from cloudinit.distros.parsers import chop_comment # See: man hosts # or http://unixhelp.ed.ac.uk/CGI/man-cgi?hosts +# or http://tinyurl.com/6lmox3 class HostsConf(object): def __init__(self, text): self._text = text @@ -80,7 +81,7 @@ class HostsConf(object): contents = StringIO() for (line_type, components) in self._contents: if line_type == 'blank': - contents.write("%s\n") + contents.write("%s\n" % (components[0])) elif line_type == 'all_comment': contents.write("%s\n" % (components[0])) elif line_type == 'option': |