PBR version lookup module incorrect in package

Bug #1441918 reported by Jamie Lennox
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-keystoneclient-kerberos
Fix Released
High
Jamie Lennox

Bug Description

Importing the base package from pip crashes with:

>>> import keystoneclient_kerberos
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/jlennox/.virtualenvs/test/lib/python2.7/site-packages/keystoneclient_kerberos/__init__.py", line 20, in <module>
    'keystoneclient_kerberos').version_string()
  File "/home/jlennox/.virtualenvs/test/lib/python2.7/site-packages/pbr/version.py", line 78, in version_string
    for part in self.release_string().split('.'):
  File "/home/jlennox/.virtualenvs/test/lib/python2.7/site-packages/pbr/version.py", line 70, in release_string
    self.release = self._get_version_from_pkg_resources()
  File "/home/jlennox/.virtualenvs/test/lib/python2.7/site-packages/pbr/version.py", line 62, in _get_version_from_pkg_resources
    return packaging.get_version(self.package)
  File "/home/jlennox/.virtualenvs/test/lib/python2.7/site-packages/pbr/packaging.py", line 567, in get_version
    raise Exception("Versioning for this project requires either an sdist"
Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. Are you sure that git is installed?

This is because the PBR string is looking for PKG-INFO from "keystoneclient_kerberos" which is the module name and not the package name. Replacing this with "python-keystoneclient-kerberos" fixes the issue.

This would not have been noticed in development because it would fallback to looking at the git repo which has the correct version number.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-keystoneclient-kerberos (master)

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

Changed in python-keystoneclient-kerberos:
assignee: nobody → Jamie Lennox (jamielennox)
status: New → In Progress
Changed in python-keystoneclient-kerberos:
importance: Undecided → High
milestone: none → 0.1.4
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-keystoneclient-kerberos (master)

Reviewed: https://review.openstack.org/171898
Committed: https://git.openstack.org/cgit/openstack/python-keystoneclient-kerberos/commit/?id=ce990bfb3c742c9f19f0af43a10aad8193fa084c
Submitter: Jenkins
Branch: master

commit ce990bfb3c742c9f19f0af43a10aad8193fa084c
Author: Jamie Lennox <email address hidden>
Date: Thu Apr 9 10:34:15 2015 +1000

    Use the package name when looking up version

    We need to give PBR the full package name when it looks up the version
    from a pip installed package. keystoneclient_kerberos is the module
    name, not the package name.

    Change-Id: I638d0975d77db3767c3675dceb05466388abebc9
    Closes-Bug: #1441918

Changed in python-keystoneclient-kerberos:
status: In Progress → Fix Committed
Changed in python-keystoneclient-kerberos:
status: Fix Committed → Fix Released
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.