yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #03372
[Bug 1194807] Re: too old oslo.config: AttributeError: 'module' object has no attribute 'DeprecatedOpt'
Reviewed: https://review.openstack.org/35296
Committed: http://github.com/openstack-infra/config/commit/69f5a95ff1f7cb5e456b488f6cb2a0c2b831bb8c
Submitter: Jenkins
Branch: master
commit 69f5a95ff1f7cb5e456b488f6cb2a0c2b831bb8c
Author: Mark McLoughlin <markmc@xxxxxxxxxx>
Date: Tue Jul 2 14:11:11 2013 +0100
Ignore --find-links lines in requirement checks
Fixes bug #1194807
In quantum, we currently have a URL based requirement:
http://.../oslo.config-1.2.0a2.tar.gz#egg=oslo.config-1.2.0a2
The requirements check currently ignores this.
It turns out that pip has a bug which doesn't where you can end up with
the oslo.config 1.1.1 code installed. This is because oslo.config>=1.1.0
gets pulled in as a transitive dep and pip gets confused. You can
reproduce with e.g.
$> pip install \
http://.../oslo.config-1.2.0a3.tar.gz#egg=oslo.config-1.2.0a3 \
python-keystoneclient
$> pip freeze | grep oslo.config
oslo.config-1.2.0a3
$> python -c 'from oslo.config.cfg import DeprecatedOpt'
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: cannot import name DeprecatedOpt
This is because of a bug with pip where it sees oslo.config-1.2.0a3 and
oslo.config as two unrelated things. It should strip the version part of
the egg= fragment before using it as a package name, but it doesn't.
However, we can simply use the -f/--find-links pip option in our
requirements.txt to add the tarball URL to the list of URLs considered
and also add the oslo.config>=1.2.0a3 dependency:
$> pip install \
-f http://.../oslo.config-1.2.0a3.tar.gz#egg=oslo.config-1.2.0a3 \
'oslo.config>=1.2.0a3' \
python-keystoneclient
$> pip freeze | grep oslo.config
oslo.config-1.2.0a3
$> python -c 'from oslo.config.cfg import DeprecatedOpt'
This is actually exactly the semantics we want and we go to great
lengths in pbr to get these semantics while using a single tarball URL.
The only downside to this --find-links strategy is that we gain an extra
line in our requirements.txt ... but it does work around the pip bug.
I think it makes sense for the requirements check to just ignore
--find-links lines for now like it does for URLs and -editable lines.
Using this method means we actually do require new versions of libraries
consumed this way to be approved into openstack/requirements first since
we have an explicit 'oslo.config>=1.2.0a3' listed rather than that being
derived from a URL.
It may make sense in future to have automation around checking which
find-links URLs are allowed ... but the same can be true for normal
dependency URLs. This change allows us to move forward and use latest
oslo.config in Nova, Neutron, etc. without falling foul of the pip bug.
Change-Id: I6f3eb5fd2c75615d9a1cae172aed859b36b27d4c
** Changed in: openstack-ci
Status: In Progress => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1194807
Title:
too old oslo.config: AttributeError: 'module' object has no attribute
'DeprecatedOpt'
Status in OpenStack Neutron (virtual network service):
In Progress
Status in OpenStack Compute (Nova):
In Progress
Status in OpenStack Core Infrastructure:
Fix Released
Status in Oslo - a Library of Common OpenStack Code:
In Progress
Status in tripleo - openstack on openstack:
Fix Released
Bug description:
quantum-server is failing to start with:
Traceback (most recent call last):
File "/opt/stack/venvs/quantum/bin/quantum-server", line 8, in <module>
load_entry_point('quantum==2013.2.a3.g090432c', 'console_scripts', 'quantum-server')()
File "/opt/stack/venvs/quantum/local/lib/python2.7/site-packages/pkg_resources.py", line 347, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/opt/stack/venvs/quantum/local/lib/python2.7/site-packages/pkg_resources.py", line 2517, in load_entry_point
return ep.load()
File "/opt/stack/venvs/quantum/local/lib/python2.7/site-packages/pkg_resources.py", line 2211, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/opt/stack/venvs/quantum/local/lib/python2.7/site-packages/quantum/server/__init__.py", line 26, in <module>
from quantum.common import config
File "/opt/stack/venvs/quantum/local/lib/python2.7/site-packages/quantum/common/config.py", line 29, in <module>
from quantum.openstack.common.db.sqlalchemy import session as db_session
File "/opt/stack/venvs/quantum/local/lib/python2.7/site-packages/quantum/openstack/common/db/sqlalchemy/session.py", line 283, in <module>
deprecated_opts=[cfg.DeprecatedOpt('sql_connection',
AttributeError: 'module' object has no attribute 'DeprecatedOpt'
Seems that something was merged in quantum that depends on trunk
unreleased oslo components.
Oslo version I've installed: oslo.config-1.1.1
To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1194807/+subscriptions