← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1768498] Re: config generation(yaml/json) broken with python3

 

Thanks for the bug report. I was able to recreate this. Fortunately, we
can keep the fix isolated to oslo.config with the patch in comment #1.

Marking this as invalid for keystone since there shouldn't be anything
specific to keystone to trigger this. This will affect any project
registering a HostAddressOpt using oslo.config and trying to generate
samples using python3.

** Changed in: keystone
       Status: New => Invalid

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Identity (keystone).
https://bugs.launchpad.net/bugs/1768498

Title:
  config generation(yaml/json) broken with python3

Status in OpenStack Identity (keystone):
  Invalid
Status in oslo.config:
  In Progress

Bug description:
  config generation with format yaml/json is broken with python3

  Reproduction steps:-
  git clone https://github.com/openstack/keystone
  cd keystone
  sed -i '/\[testenv\:genconfig\]/a basepython=python3' tox.ini
  tox -egenconfig
  .tox/genconfig/bin/oslo-config-generator --config-file=config-generator/keystone.conf --format yaml --output-file=keystone-schema.yaml

  The above command works fine when basepython=python2

  with "ini" it works fine:-
  .tox/genconfig/bin/oslo-config-generator --config-file=config-generator/keystone.conf --format ini --output-file=keystone-schema.yaml


  Actual Output:-
  Traceback (most recent call last):
    File ".tox/genconfig/bin/oslo-config-generator", line 11, in <module>
      sys.exit(main())
    File "/home/ykarel/work/keystone/.tox/genconfig/lib/python3.6/site-packages/oslo_config/generator.py", line 770, in main
      generate(conf)
    File "/home/ykarel/work/keystone/.tox/genconfig/lib/python3.6/site-packages/oslo_config/generator.py", line 754, in generate
      conf=conf)
    File "/home/ykarel/work/keystone/.tox/genconfig/lib/python3.6/site-packages/oslo_config/generator.py", line 690, in _output_machine_readable
      output_data = _generate_machine_readable_data(groups, conf)
    File "/home/ykarel/work/keystone/.tox/genconfig/lib/python3.6/site-packages/oslo_config/generator.py", line 655, in _generate_machine_readable_data
      entry = _build_entry(opt, group_name, namespace[0], conf)
    File "/home/ykarel/work/keystone/.tox/genconfig/lib/python3.6/site-packages/oslo_config/generator.py", line 601, in _build_entry
      entry['type'] = _format_type_name(entry['type'])
    File "/home/ykarel/work/keystone/.tox/genconfig/lib/python3.6/site-packages/oslo_config/generator.py", line 157, in _format_type_name
      return _TYPE_NAMES[opt_type]
  TypeError: unhashable type: 'HostAddress'

  Expected Output:-
  keystone-schema.yaml should be generated

  
  This should be a bug for oslo.config, but found in keystone so reporting against it as well.

To manage notifications about this bug go to:
https://bugs.launchpad.net/keystone/+bug/1768498/+subscriptions


References