diff options
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | cloudinit/CloudConfig/cc_set_hostname.py | 4 |
2 files changed, 3 insertions, 2 deletions
@@ -47,6 +47,7 @@ - change the mechanism for handling .ssh/authorized_keys, to update entries rather than appending. This ensures that the authorized_keys that are being inserted actually do something (LP: #434076, LP: #833499) + - log warning on failure to set hostname (LP: #832175) 0.6.1: - fix bug in fixing permission on /var/log/cloud-init.log (LP: #704509) diff --git a/cloudinit/CloudConfig/cc_set_hostname.py b/cloudinit/CloudConfig/cc_set_hostname.py index b505b621..bc190049 100644 --- a/cloudinit/CloudConfig/cc_set_hostname.py +++ b/cloudinit/CloudConfig/cc_set_hostname.py @@ -28,11 +28,11 @@ def handle(name,cfg,cloud,log,args): set_hostname(hostname, log) except Exception as e: util.logexc(log) - log.warn("failed to set hostname\n") + log.warn("failed to set hostname to %s\n", hostname) return(True) def set_hostname(hostname, log): - subprocess.Popen(['hostname', hostname]).communicate() + util.subp(['hostname', hostname]) util.write_file("/etc/hostname","%s\n" % hostname, 0644) log.debug("populated /etc/hostname with %s on first boot", hostname) |