summaryrefslogtreecommitdiff
path: root/openstackclient
diff options
context:
space:
mode:
authorDean Troyer <dtroyer@gmail.com>2013-08-02 11:57:17 -0500
committerDean Troyer <dtroyer@gmail.com>2013-08-02 12:11:49 -0500
commitaf874890221b145a8cb423d3c1fc5dc133dbef13 (patch)
tree980a89b50f30f3f6e7fa3a7e818e0bd9dff84539 /openstackclient
parentd67524897b55af99adfef0017a071d36a1f6003f (diff)
downloadpython-openstackclient-0.2.0.tar.gz
Change version reporting to use pbr0.2.0
Gets rid of the hard-coded version string in shell.py Change-Id: I8b818c9a8f1224669079141e7a7caf614e588d20
Diffstat (limited to 'openstackclient')
-rw-r--r--openstackclient/__init__.py12
-rw-r--r--openstackclient/shell.py4
2 files changed, 12 insertions, 4 deletions
diff --git a/openstackclient/__init__.py b/openstackclient/__init__.py
index 85ac2501..89deee32 100644
--- a/openstackclient/__init__.py
+++ b/openstackclient/__init__.py
@@ -1,5 +1,3 @@
-# Copyright 2012-2013 OpenStack, LLC.
-#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
@@ -12,3 +10,13 @@
# License for the specific language governing permissions and limitations
# under the License.
#
+
+__all__ = ['__version__']
+
+import pbr.version
+
+version_info = pbr.version.VersionInfo('python-openstackclient')
+try:
+ __version__ = version_info.version_string()
+except AttributeError:
+ __version__ = None
diff --git a/openstackclient/shell.py b/openstackclient/shell.py
index 8a15bc9b..b66611b1 100644
--- a/openstackclient/shell.py
+++ b/openstackclient/shell.py
@@ -24,6 +24,7 @@ import sys
from cliff import app
from cliff import help
+import openstackclient
from openstackclient.common import clientmanager
from openstackclient.common import commandmanager
from openstackclient.common import exceptions as exc
@@ -31,7 +32,6 @@ from openstackclient.common import openstackkeyring
from openstackclient.common import utils
-VERSION = '0.2.rc1'
KEYRING_SERVICE = 'openstack'
DEFAULT_COMPUTE_API_VERSION = '2'
@@ -64,7 +64,7 @@ class OpenStackShell(app.App):
def __init__(self):
super(OpenStackShell, self).__init__(
description=__doc__.strip(),
- version=VERSION,
+ version=openstackclient.__version__,
command_manager=commandmanager.CommandManager('openstack.cli'))
# This is instantiated in initialize_app() only when using