Pypi python-keystoneclient(v0.2.2) not compatible with the latest oslo.config-1.1

Bug #1151665 reported by Lianhao Lu
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
High
Lianhao Lu
python-keystoneclient
Invalid
Critical
Unassigned

Bug Description

When using the following dependencies in the file tools/pip-requires:
    python-keystoneclient>=0.2
    http://tarballs.openstack.org/oslo-config/oslo.config-1.1.0b1.tar.gz#egg=oslo.config

The keystoneclient.middleware.auth_token module in Pypi python-keystoneclient v0.2.2 is still using old openstack.common.cfg, which is not compatible with the latest oslo.config-1.1.0.

Using the things like the following(see the attchment for the test python script)

    import keystoneclient.middleware.auth_token as auth_token
    from oslo.config import cfg

    cfg.CONF.register_opts(auth_token.opts, group=OPT_GROUP_NAME)
    cfg.CONF([ '--config-file=%s' % tmpfile], project='ceilometer')
    a=cfg.CONF.get(OPT_GROUP_NAME)
    print dict(a)

Would result the following error:
Traceback (most recent call last):
  File "a.py", line 19, in <module>
    print dict(a)
  File "/opt/stack/ceilometer/.tox/py27/local/lib/python2.7/site-packages/oslo/config/cfg.py", line 1713, in __getitem__
    return self.__getattr__(key)
  File "/opt/stack/ceilometer/.tox/py27/local/lib/python2.7/site-packages/oslo/config/cfg.py", line 1709, in __getattr__
    return self._conf._get(name, self._group)
  File "/opt/stack/ceilometer/.tox/py27/local/lib/python2.7/site-packages/oslo/config/cfg.py", line 1514, in _get
    value = self._substitute(self._do_get(name, group))
  File "/opt/stack/ceilometer/.tox/py27/local/lib/python2.7/site-packages/oslo/config/cfg.py", line 1547, in _do_get
    raise ConfigFileValueError(str(ve))
ConfigFileValueError: need more than 1 value to unpack

Revision history for this message
Lianhao Lu (lianhao-lu) wrote :
Revision history for this message
Mark McLoughlin (markmc) wrote :

Latest keystoneclient will try and use oslo.config. Sounds like we need a release to include that?

Changed in python-keystoneclient:
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Lianhao Lu (lianhao-lu) wrote :
Revision history for this message
Mark McLoughlin (markmc) wrote :

Ok, thanks for the test case

Here's a scarey traceback:

  File "a.py", line 21, in <module>
    print dict(a)
  File "/home/markmc/git/openstack/oslo-config/oslo/config/cfg.py", line 1676, in __getitem__
    return self.__getattr__(key)
  File "/home/markmc/git/openstack/oslo-config/oslo/config/cfg.py", line 1672, in __getattr__
    return self._conf._get(name, self._group)
  File "/home/markmc/git/openstack/oslo-config/oslo/config/cfg.py", line 1477, in _get
    value = self._substitute(self._do_get(name, group))
  File "/home/markmc/git/openstack/oslo-config/oslo/config/cfg.py", line 1506, in _do_get
    value = opt._get_from_config_parser(self._cparser, section)
  File "/home/markmc/git/openstack/python-keystoneclient/keystoneclient/openstack/common/cfg.py", line 669, in _get_from_config_parser
    self._cparser_get_with_deprecated(cparser, section)]
  File "/home/markmc/git/openstack/python-keystoneclient/keystoneclient/openstack/common/cfg.py", line 552, in _cparser_get_with_deprecated
    return cparser.get(section, [self.dest])
  File "/home/markmc/git/openstack/oslo-config/oslo/config/cfg.py", line 1006, in get
    traceback.print_stack()

The issue is that there is an internal contract in cfg between the Opt class and the MultiConfigParser class

With keystoneclient 0.2.2 it's an oslo.config.cfg.ConfigOpts object calling a keystoneclient.openstack.common.cfg.Opt objects which, in turn, calls back to an oslo.config.cfg.MultiConfigParser object

In 2013.1b4 the oslo.config.cfg.MultiConfigParser interface matches the keystone.openstack.common.MultiConfigParser interface but in 2013.1b4, oslo.config.cfg.MultiConfigParser has changed but keystoneclient.openstack.common.cfg.Opt is obviously still expecting the old interface

The conclusion remains the same, I think - we need a new release of keystoneclient which will use oslo.config

Changed in python-keystoneclient:
importance: High → Critical
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

Reviewed: https://review.openstack.org/23797
Committed: http://github.com/openstack/ceilometer/commit/df0a2ca24be6229e29b7cb340f8286a54a726ebf
Submitter: Jenkins
Branch: master

commit df0a2ca24be6229e29b7cb340f8286a54a726ebf
Author: Lianhao Lu <email address hidden>
Date: Thu Mar 7 17:52:22 2013 +0800

    Fix oslo.config and unittest.

    Switch to the new oslo.config package which was renamed from
    oslo-config.

    Use python-keystoneclient master version as a temporary workaround for
    bug #1151665.

    Temporary workdaround of the bug #1151345 by comment out the test code
    to pass the jenkin's gate test.

    Change-Id: I7c223f3e98c5d33993b345d93c27f97d3d926d80

Changed in ceilometer:
status: New → Fix Committed
Revision history for this message
Lianhao Lu (lianhao-lu) wrote :

Patch https://review.openstack.org/23797 was only a workaround to unblock the jenkin's gate test jobs. Leave it for tracking.
Waiting for the new version of python-keystoneclient on pypi.

Changed in ceilometer:
status: Fix Committed → Confirmed
Lianhao Lu (lianhao-lu)
Changed in ceilometer:
milestone: none → grizzly-rc1
Changed in python-keystoneclient:
status: Confirmed → In Progress
Revision history for this message
Lianhao Lu (lianhao-lu) wrote :

Since python-keystoneclient 0.2.3 is available on pypi, we should modify the previous workaround to have ceilometer depend on new version.

Changed in ceilometer:
assignee: nobody → Lianhao Lu (lianhao-lu)
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ceilometer (master)

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

Changed in ceilometer:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

Reviewed: https://review.openstack.org/24755
Committed: http://github.com/openstack/ceilometer/commit/cf1c2d6259707905341d288e189109e497230be4
Submitter: Jenkins
Branch: master

commit cf1c2d6259707905341d288e189109e497230be4
Author: Lianhao Lu <email address hidden>
Date: Tue Mar 19 14:11:56 2013 +0800

    Switch to python-keystoneclient 0.2.3.

    Fixed the bug #1151665 by having python-keystoneclient dependency to
    version >=0.2.3.

    Also fixed the issue of setting the fake memory cache for keystone
    middleware in unit test by using the correct configuration and request
    environment.

    Change-Id: Id3706bea6083c03adc46a8716c5cb8074339fc45

Changed in ceilometer:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in ceilometer:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: grizzly-rc1 → 2013.1
Revision history for this message
Dolph Mathews (dolph) wrote :

Sounds like there's nothing to actually fix on the keystoneclient side here

Changed in python-keystoneclient:
status: In Progress → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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