summaryrefslogtreecommitdiff
path: root/cloudinit/distros/debian.py
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2012-11-08 17:37:16 -0800
committerJoshua Harlow <harlowja@yahoo-inc.com>2012-11-08 17:37:16 -0800
commitb80c2401123e16b9038ff3fb6f6d660717ee68e1 (patch)
treec5f1d94c380961ea81644fbafb3218d16299ff4f /cloudinit/distros/debian.py
parent6240367f1e87b077c81a8af2883cd4b50f64d76b (diff)
downloadvyos-cloud-init-b80c2401123e16b9038ff3fb6f6d660717ee68e1.tar.gz
vyos-cloud-init-b80c2401123e16b9038ff3fb6f6d660717ee68e1.zip
Fix the case where on a redhat based system
the fully qualified domain name should end up in /etc/sysconfig/network by passing the fqdn to the update and set hostname methods and using it accordingly. LP: #1076759
Diffstat (limited to 'cloudinit/distros/debian.py')
-rw-r--r--cloudinit/distros/debian.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/cloudinit/distros/debian.py b/cloudinit/distros/debian.py
index cc7e53a0..ed4070b4 100644
--- a/cloudinit/distros/debian.py
+++ b/cloudinit/distros/debian.py
@@ -67,7 +67,7 @@ class Distro(distros.Distro):
else:
return distros.Distro._bring_up_interfaces(self, device_names)
- def set_hostname(self, hostname):
+ def set_hostname(self, hostname, fqdn=None):
self._write_hostname(hostname, "/etc/hostname")
LOG.debug("Setting hostname to %s", hostname)
util.subp(['hostname', hostname])
@@ -76,7 +76,7 @@ class Distro(distros.Distro):
# "" gives trailing newline.
util.write_file(out_fn, "%s\n" % str(hostname), 0644)
- def update_hostname(self, hostname, prev_fn):
+ def update_hostname(self, hostname, fqdn, prev_fn):
hostname_prev = self._read_hostname(prev_fn)
hostname_in_etc = self._read_hostname("/etc/hostname")
update_files = []