summaryrefslogtreecommitdiff
path: root/heatclient/__init__.py
diff options
context:
space:
mode:
authorZhiQiang Fan <aji.zqfan@gmail.com>2013-09-04 14:10:55 +0800
committerZhiQiang Fan <aji.zqfan@gmail.com>2013-09-04 14:29:56 +0800
commit5cb3fc07d50d76133565717659abc886d43fc2a2 (patch)
tree4dc18267895405b1ef864363f3401c5265676940 /heatclient/__init__.py
parente2cbb450361893976316211cb1656d6cf8de686d (diff)
downloadpython-heatclient-5cb3fc07d50d76133565717659abc886d43fc2a2.tar.gz
Support --version for heatclient
Closes-Bug: #1220524 Change-Id: Id78f7c7c78d31c0126b43f7a846f02f2542b0b7c
Diffstat (limited to 'heatclient/__init__.py')
-rw-r--r--heatclient/__init__.py19
1 files changed, 2 insertions, 17 deletions
diff --git a/heatclient/__init__.py b/heatclient/__init__.py
index 09d0195..e589bb4 100644
--- a/heatclient/__init__.py
+++ b/heatclient/__init__.py
@@ -9,23 +9,8 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
-import inspect
-import os
+import pbr.version
-def _get_heatclient_version():
- """Read version from versioninfo file."""
- mod_abspath = inspect.getabsfile(inspect.currentframe())
- heatclient_path = os.path.dirname(mod_abspath)
- version_path = os.path.join(heatclient_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_heatclient_version()
+__version__ = pbr.version.VersionInfo('python-heatclient').version_string()