osprofiler can't show its version

Bug #1551079 reported by ChangBo Guo(gcb)
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
osprofiler
Fix Released
Undecided
ChangBo Guo(gcb)

Bug Description

After install osprofiler by command " python setup.py install".

osprofiler --version shows nothing

[changboguo@localhost osprofiler]$ python
Python 2.7.10 (default, Sep 24 2015, 17:50:09)
[GCC 5.1.1 20150618 (Red Hat 5.1.1-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import osprofiler
>>> osprofiler.__version__
>>> print(osprofiler.__version__)
None
>>>

the root cause is wrong way to generate version :

import os

from six.moves import configparser

from osprofiler import _utils as utils

utils.import_modules_from_package("osprofiler._notifiers")

_conf = configparser.ConfigParser()
_conf.read(os.path.join(
    os.path.dirname(os.path.dirname(__file__)), "setup.cfg"))
try:
    __version__ = _conf.get("metadata", "version")
except (configparser.NoOptionError, configparser.NoSectionError):
    __version__ = None

we never has version option in setup.cfg. so we never got a version for osprofiler.

Changed in osprofiler:
assignee: nobody → ChangBo Guo(gcb) (glongwave)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to osprofiler (master)

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

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

Reviewed: https://review.openstack.org/285890
Committed: https://git.openstack.org/cgit/openstack/osprofiler/commit/?id=e53471ac363b894734a90313ec9738236f99596a
Submitter: Jenkins
Branch: master

commit e53471ac363b894734a90313ec9738236f99596a
Author: ChangBo Guo(gcb) <email address hidden>
Date: Mon Feb 29 13:28:29 2016 +0800

    Use pkg_resources to get version

    Current osprofiler can't show version due to
    wrong way to generate module version.
    Use pkg_resources to get version.

    Note: we don't want to usr pbr in runtime.

    Closes-Bug: #1551079
    Change-Id: I5b728c9b8295620b806335e7d95f9a4fbc33d1cc

Changed in osprofiler:
status: In Progress → Fix Released
Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote : Fix included in openstack/osprofiler 1.3.0

This issue was fixed in the openstack/osprofiler 1.3.0 release.

Revision history for this message
Doug Hellmann (doug-hellmann) wrote :

This issue was fixed in the openstack/osprofiler 1.3.0 release.

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.