diff options
author | Scott Moser <smoser@ubuntu.com> | 2011-09-01 10:16:36 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2011-09-01 10:16:36 -0400 |
commit | 3197810f17e3267e9147d0572079d8133d9f61e4 (patch) | |
tree | 01a15b3ea011d3765b2fff34f1fe77aded734bdc | |
parent | 8a42512443986326f3bdcf25fadc0c2aad9cccff (diff) | |
download | vyos-cloud-init-3197810f17e3267e9147d0572079d8133d9f61e4.tar.gz vyos-cloud-init-3197810f17e3267e9147d0572079d8133d9f61e4.zip |
warn on failure of the hostname command when setting hostname
LP: #832175
-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) |