Doesn't configure landscape client on py3
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Fix Released
|
High
|
Chad Smith |
Bug Description
Attempting to configure landscape-client on a py3 system falls over due to string/byte-string conversion issues
Here's a sample run from MAAS:
2017-08-15 17:58:11,883 - util.py[DEBUG]: Running module landscape (<module 'cloudinit.
Traceback (most recent call last):
File "/usr/lib/
freq=freq)
File "/usr/lib/
return self._runners.
File "/usr/lib/
results = functor(*args)
File "/usr/lib/
merged.
File "/usr/lib/
outfile.
TypeError: string argument expected, got 'bytes'
ubuntu@
landscape:
client:
url: "https:/
ping_url: "http://
data_path: "/var/lib/
#http_proxy: "http://
tags: "maas"
computer_title: withkvm
#https_proxy: fooproxy
registratio
account_name: standalone
Ryan validated py3 falling over just on basic ConfigObj.write() attempts:
(foudres) ~ % python3
Python 3.5.2 (default, Nov 17 2016, 17:05:23)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from configobj import ConfigObj
>>> from six import StringIO
>>> contents = StringIO()
>>> merged = cfg = ConfigObj({})
>>> merged
ConfigObj({})
>>> cfg.merge({'a': 1})
>>> cfg
ConfigObj({'a': 1})
>>> type(contents)
<class '_io.StringIO'>
>>> merged.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/
outfile.
TypeError: string argument expected, got 'bytes'
Related branches
- Scott Moser: Approve
- Server Team CI bot: Approve (continuous-integration)
-
Diff: 402 lines (+298/-24)5 files modifiedcloudinit/config/cc_landscape.py (+2/-2)
cloudinit/config/cc_puppet.py (+18/-15)
cloudinit/helpers.py (+7/-7)
tests/unittests/test_handler/test_handler_landscape.py (+129/-0)
tests/unittests/test_handler/test_handler_puppet.py (+142/-0)
Changed in cloud-init: | |
status: | Confirmed → Fix Committed |
You've an error in your cloud-config file
ubuntu@ withkvm: /var/log$ cat /etc/cloud/ cloud.cfg. d/99_landscape_ client
cloud-config files need a .cfg extension to be read.
If I use your landscape config this way, I see landscape-client installed and file written.
% cat landscape.yaml /192.168. 122.1/message- system" 192.168. 122.1/ping" landscape/ client" my.proxy. com/foobar" n_key: test
#cloud-config
landscape:
client:
url: "https:/
ping_url: "http://
data_path: "/var/lib/
#http_proxy: "http://
tags: "maas"
computer_title: withkvm
#https_proxy: fooproxy
registratio
account_name: standalone
% lxc launch ubuntu-daily:artful --config= user.user- data="$ (cat landscape.yaml)"
# wait a bit for install to complete
% lxc exec measured-hyena -- dpkg --list | grep landscape
ii landscape-client 16.03-0ubuntu3 amd64 The Landscape administration system client
ii landscape-common 16.03-0ubuntu3 amd64 The Landscape administration system client - Common files
it appears to be working fine. If you feel there's still a bug, please re-open.