← Back to team overview

cloud-init-dev team mailing list archive

[Merge] ~powersj/cloud-init:fix-arch-hostname into cloud-init:master


Joshua Powers has proposed merging ~powersj/cloud-init:fix-arch-hostname into cloud-init:master.

Commit message:
archlinux: fix set hostname

cloud-init fails to set the hostname on Arch Linux becuase that
_write_hostname passes conf instead of str(conf) to util.write_file.

LP: #1705306

Requested reviews:
  cloud-init commiters (cloud-init-dev)
Related bugs:
  Bug #1705306 in cloud-init: "Cannot set hostname on Arch Linux"

For more details, see:
Your team cloud-init commiters is requested to review the proposed merge of ~powersj/cloud-init:fix-arch-hostname into cloud-init:master.
diff --git a/cloudinit/distros/arch.py b/cloudinit/distros/arch.py
index 75d4620..8a9c359 100644
--- a/cloudinit/distros/arch.py
+++ b/cloudinit/distros/arch.py
@@ -119,7 +119,7 @@ class Distro(distros.Distro):
         if not conf:
             conf = HostnameConf('')
-        util.write_file(out_fn, conf, 0o644)
+        util.write_file(out_fn, str(conf), 0o644)
     def _read_system_hostname(self):
         sys_hostname = self._read_hostname(self.hostname_conf_fn)

Follow ups