Loading configuration items from keystoneauth is causing warnings

Bug #1525275 reported by Martin Hickey
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
keystoneauth
Invalid
Undecided
Unassigned
oslo.config
Fix Released
Undecided
Brant Knudson

Bug Description

Neutron uses the oslo-config-generator to automatically generate configuration files.

Some configuration items are authentication items retrieved from keystone like 'domain-id', 'password' etc. These items are retrieved in https://github.com/openstack/neutron/blob/master/neutron/opts.py#L275.

The following warnings are now been output when you run the tox target to generate config items (tox -e genconfig) or pep8 as it also generates the config files:

/opt/stack/neutron/.tox/pep8/local/lib/python2.7/site-packages/oslo_config/generator.py:204: UserWarning: Option auth_type should have a type derived from types.ConfigType instead of <type 'str'>
  warnings.warn(msg)
/opt/stack/neutron/.tox/pep8/local/lib/python2.7/site-packages/oslo_config/generator.py:204: UserWarning: Option auth_section should have a type derived from types.ConfigType instead of <type 'str'>
  warnings.warn(msg)
/opt/stack/neutron/.tox/pep8/local/lib/python2.7/site-packages/oslo_config/generator.py:204: UserWarning: Option auth-url should have a type derived from types.ConfigType instead of <type 'str'>
  warnings.warn(msg)
/opt/stack/neutron/.tox/pep8/local/lib/python2.7/site-packages/oslo_config/generator.py:204: UserWarning: Option default-domain-id should have a type derived from types.ConfigType instead of <type 'str'>
  warnings.warn(msg)
/opt/stack/neutron/.tox/pep8/local/lib/python2.7/site-packages/oslo_config/generator.py:204: UserWarning: Option default-domain-name should have a type derived from types.ConfigType instead of <type 'str'>
  warnings.warn(msg)
/opt/stack/neutron/.tox/pep8/local/lib/python2.7/site-packages/oslo_config/generator.py:204: UserWarning: Option domain-id should have a type derived from types.ConfigType instead of <type 'str'>
  warnings.warn(msg)
/opt/stack/neutron/.tox/pep8/local/lib/python2.7/site-packages/oslo_config/generator.py:204: UserWarning: Option domain-name should have a type derived from types.ConfigType instead of <type 'str'>
  warnings.warn(msg)
/opt/stack/neutron/.tox/pep8/local/lib/python2.7/site-packages/oslo_config/generator.py:204: UserWarning: Option password should have a type derived from types.ConfigType instead of <type 'str'>
  warnings.warn(msg)
/opt/stack/neutron/.tox/pep8/local/lib/python2.7/site-packages/oslo_config/generator.py:204: UserWarning: Option project-domain-id should have a type derived from types.ConfigType instead of <type 'str'>
  warnings.warn(msg)
/opt/stack/neutron/.tox/pep8/local/lib/python2.7/site-packages/oslo_config/generator.py:204: UserWarning: Option project-domain-name should have a type derived from types.ConfigType instead of <type 'str'>
  warnings.warn(msg)
/opt/stack/neutron/.tox/pep8/local/lib/python2.7/site-packages/oslo_config/generator.py:204: UserWarning: Option project-id should have a type derived from types.ConfigType instead of <type 'str'>
  warnings.warn(msg)
/opt/stack/neutron/.tox/pep8/local/lib/python2.7/site-packages/oslo_config/generator.py:204: UserWarning: Option project-name should have a type derived from types.ConfigType instead of <type 'str'>
  warnings.warn(msg)
/opt/stack/neutron/.tox/pep8/local/lib/python2.7/site-packages/oslo_config/generator.py:204: UserWarning: Option tenant-id should have a type derived from types.ConfigType instead of <type 'str'>
  warnings.warn(msg)
/opt/stack/neutron/.tox/pep8/local/lib/python2.7/site-packages/oslo_config/generator.py:204: UserWarning: Option tenant-name should have a type derived from types.ConfigType instead of <type 'str'>
  warnings.warn(msg)
/opt/stack/neutron/.tox/pep8/local/lib/python2.7/site-packages/oslo_config/generator.py:204: UserWarning: Option trust-id should have a type derived from types.ConfigType instead of <type 'str'>
  warnings.warn(msg)
/opt/stack/neutron/.tox/pep8/local/lib/python2.7/site-packages/oslo_config/generator.py:204: UserWarning: Option user-domain-id should have a type derived from types.ConfigType instead of <type 'str'>
  warnings.warn(msg)
/opt/stack/neutron/.tox/pep8/local/lib/python2.7/site-packages/oslo_config/generator.py:204: UserWarning: Option user-domain-name should have a type derived from types.ConfigType instead of <type 'str'>
  warnings.warn(msg)
/opt/stack/neutron/.tox/pep8/local/lib/python2.7/site-packages/oslo_config/generator.py:204: UserWarning: Option user-id should have a type derived from types.ConfigType instead of <type 'str'>
  warnings.warn(msg)
/opt/stack/neutron/.tox/pep8/local/lib/python2.7/site-packages/oslo_config/generator.py:204: UserWarning: Option user-name should have a type derived from types.ConfigType instead of <type 'str'>
  warnings.warn(msg)

These warnings may have been introduced with the following change: https://github.com/openstack/neutron/commit/a37e11f637b21785307e14e9725de3db14a1d37b

description: updated
Brant Knudson (blk-u)
no longer affects: keystone
Revision history for this message
Brant Knudson (blk-u) wrote :

keystoneauth has a function _to_oslo_opt[1] that creates oslo_config opts, and it passes type=self.type, but self.type defaults to str. Looks like keystoneauth also needs to convert the type allowed by keystoneauth to oslo's ConfigType.

[1] http://git.openstack.org/cgit/openstack/keystoneauth/tree/keystoneauth1/loading/opts.py?id=30f9a02fa2552db2fe6a0f61f6fa761094e1f663#n100

Revision history for this message
Brant Knudson (blk-u) wrote :

According to the docs for oslo.config[1], the type "Must be a callable object that takes string and returns converted and validated value", it doesn't say anything about the type having to be a ConfigType, so I don't see why the config generator is warning about this.

[1] http://docs.openstack.org/developer/oslo.config/opts.html#oslo_config.cfg.Opt

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo.config (master)

Fix proposed to branch: master
Review: https://review.openstack.org/256594

Changed in oslo.config:
assignee: nobody → Brant Knudson (blk-u)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo.config (master)

Reviewed: https://review.openstack.org/256594
Committed: https://git.openstack.org/cgit/openstack/oslo.config/commit/?id=271da1c8170d961ccad9862a0c28f3303bfc6e03
Submitter: Jenkins
Branch: master

commit 271da1c8170d961ccad9862a0c28f3303bfc6e03
Author: Brant Knudson <email address hidden>
Date: Fri Dec 11 11:16:30 2015 -0600

    Remove warning for option type not a ConfigType

    The documentation for cfg.Opt[1] only says that the type parameter
    must be a callable object, not that it must be a subclass of
    types.ConfigType, so there shouldn't be a warning from the config
    generator when the type is not a subclass of types.ConfigType.

    [1] http://docs.openstack.org/developer/oslo.config/opts.html#oslo_config.cfg.Opt

    Change-Id: Ia38b471d52b3987b65d93b11d805c523276bdbfc
    Closes-Bug: 1525275

Changed in oslo.config:
status: In Progress → Fix Released
Revision history for this message
Morgan Fainberg (mdrnstm) wrote :

IS this still an issue with the oslo.config update?

Changed in keystoneauth:
importance: Undecided → Medium
status: New → Confirmed
status: Confirmed → Triaged
importance: Medium → Undecided
status: Triaged → New
status: New → Incomplete
Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote : Fix included in openstack/oslo.config 3.2.0

This issue was fixed in the openstack/oslo.config 3.2.0 release.

Changed in keystoneauth:
status: Incomplete → Won't Fix
status: Won't Fix → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.