summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy McCrae <andy.mccrae@googlemail.com>2013-06-03 13:33:57 +0100
committerAndy McCrae <andy.mccrae@googlemail.com>2013-06-03 13:33:57 +0100
commit8a09e49cbcb9a874619b0e06601c2d69d5dad738 (patch)
treefd1b7e600841c5ea59ee8b21b419529e5c566a56
parent6753889314c3b7aed9ff9f032cc7483005b68dcf (diff)
downloadpython-keystoneclient-8a09e49cbcb9a874619b0e06601c2d69d5dad738.tar.gz
Fix --version to output version
Change-Id: I7d8dc83ac7c2ad7519633d136c1c32ce8537dce8 Fixes: bug 1182675
-rw-r--r--keystoneclient/__init__.py20
1 files changed, 2 insertions, 18 deletions
diff --git a/keystoneclient/__init__.py b/keystoneclient/__init__.py
index 0b4062d..d13c009 100644
--- a/keystoneclient/__init__.py
+++ b/keystoneclient/__init__.py
@@ -13,23 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
-import inspect
-import os
+import pbr.version
-def _get_client_version():
- """Read version from versioninfo file."""
- mod_abspath = inspect.getabsfile(inspect.currentframe())
- client_path = os.path.dirname(mod_abspath)
- version_path = os.path.join(client_path, 'versioninfo')
-
- if os.path.exists(version_path):
- version = open(version_path).read().strip()
- else:
- version = "Unknown, couldn't find versioninfo file at %s"\
- % version_path
-
- return version
-
-
-__version__ = _get_client_version()
+__version__ = pbr.version.VersionInfo('python-keystoneclient').version_string()