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 /cloudinit/CloudConfig | |
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
Diffstat (limited to 'cloudinit/CloudConfig')
-rw-r--r-- | cloudinit/CloudConfig/cc_set_hostname.py | 4 |
1 files changed, 2 insertions, 2 deletions
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) |