← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1710932] Re: Doesn't configure landscape client on py3

 

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/1710932

Title:
  Doesn't configure landscape client on py3

Status in cloud-init:
  Fix Released

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.config.cc_landscape' from '/usr/lib/python3/dist-packages/cloudinit/config/cc_landscape.py'>) failed
  Traceback (most recent call last):
    File "/usr/lib/python3/dist-packages/cloudinit/stages.py", line 793, in _run_modules
      freq=freq)
    File "/usr/lib/python3/dist-packages/cloudinit/cloud.py", line 54, in run
      return self._runners.run(name, functor, args, freq, clear_on_fail)
    File "/usr/lib/python3/dist-packages/cloudinit/helpers.py", line 187, in run
      results = functor(*args)
    File "/usr/lib/python3/dist-packages/cloudinit/config/cc_landscape.py", line 113, in handle
      merged.write(contents)
    File "/usr/lib/python3/dist-packages/configobj.py", line 2126, in write
      outfile.write(output_bytes)
  TypeError: string argument expected, got 'bytes'

  ubuntu@withkvm:/etc/landscape$ cat /etc/cloud/cloud.cfg.d/99_landscape_client.cfg
  landscape:
    client:
      url: "https://192.168.122.1/message-system";
      ping_url: "http://192.168.122.1/ping";
      data_path: "/var/lib/landscape/client"
      #http_proxy: "http://my.proxy.com/foobar";
      tags: "maas"
      computer_title: withkvm
      #https_proxy: fooproxy
      registration_key: test
      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.write(contents)
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/usr/lib/python3/dist-packages/configobj.py", line 2126, in write
      outfile.write(output_bytes)
  TypeError: string argument expected, got 'bytes'

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


References