From af874890221b145a8cb423d3c1fc5dc133dbef13 Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Fri, 2 Aug 2013 11:57:17 -0500 Subject: Change version reporting to use pbr Gets rid of the hard-coded version string in shell.py Change-Id: I8b818c9a8f1224669079141e7a7caf614e588d20 --- openstackclient/__init__.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'openstackclient/__init__.py') 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 -- cgit v1.2.1