From 3197810f17e3267e9147d0572079d8133d9f61e4 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Thu, 1 Sep 2011 10:16:36 -0400 Subject: warn on failure of the hostname command when setting hostname LP: #832175 --- cloudinit/CloudConfig/cc_set_hostname.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cloudinit') 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) -- cgit v1.2.3