From 8d453d2a4da4492857a4487b14fe7b11a014115b Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Fri, 16 Jan 2015 14:29:48 -0500 Subject: hostname: apply hostname same as is written on RHEL, we were writing to persistent configuration the fqdn, but invoking 'hostname' on the first boot with just the shortname. On 'reboot', then the hostname would differ. Now, whatever we write, invoke hostname with. Also remove some duplicate code. LP: #1246485 --- cloudinit/distros/sles.py | 7 ------- 1 file changed, 7 deletions(-) (limited to 'cloudinit/distros/sles.py') diff --git a/cloudinit/distros/sles.py b/cloudinit/distros/sles.py index 9788a1ba..43682a12 100644 --- a/cloudinit/distros/sles.py +++ b/cloudinit/distros/sles.py @@ -115,13 +115,6 @@ class Distro(distros.Distro): conf.set_hostname(hostname) util.write_file(out_fn, str(conf), 0644) - def _select_hostname(self, hostname, fqdn): - # Prefer the short hostname over the long - # fully qualified domain name - if not hostname: - return fqdn - return hostname - def _read_system_hostname(self): host_fn = self.hostname_conf_fn return (host_fn, self._read_hostname(host_fn)) -- cgit v1.2.3