← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1705306] Re: Cannot set hostname on Arch Linux

 

This bug is believed to be fixed in cloud-init in 17.1. If this is still
a problem for you, please make a comment and set the state back to New

Thank you.

** Changed in: cloud-init
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1705306

Title:
  Cannot set hostname on Arch Linux

Status in cloud-init:
  Fix Released

Bug description:
  cloud-init fails to set the hostname on Arch Linux with the following
  error:

  [CLOUDINIT] util.py[DEBUG]: Failed to set the hostname to dev1.localdomain (dev1)
    Traceback (most recent call last):
      File "/usr/lib/python2.7/site-packages/cloudinit/config/cc_set_hostname.py", line 33, in handle
        cloud.distro.set_hostname(hostname, fqdn)
      File "/usr/lib/python2.7/site-packages/cloudinit/distros/__init__.py", line 96, in set_hostname
        self._write_hostname(writeable_hostname, self.hostname_conf_fn)
      File "/usr/lib/python2.7/site-packages/cloudinit/distros/arch.py", line 132, in _write_hostname
        util.write_file(out_fn, conf, 0o644)
      File "/usr/lib/python2.7/site-packages/cloudinit/util.py", line 1662, in write_file
        content = encode_text(content)
      File "/usr/lib/python2.7/site-packages/cloudinit/util.py", line 97, in encode_text
        return text.encode(encoding)
    AttributeError: 'HostnameConf' object has no attribute 'encode'

  The bug is that _write_hostname passes conf instead of str(conf) to
  util.write_file (compare distros/arch.py#n122 and
  distros/debian.py#n112).

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1705306/+subscriptions


References