yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #65952
[Bug 1705306] [NEW] Cannot set hostname on Arch Linux
Public bug reported:
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).
** Affects: cloud-init
Importance: Undecided
Status: New
** Description changed:
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'
+ 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).
--
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:
New
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
Follow ups