From d79f44e970026f680c687cc66047e80b88e81d8b Mon Sep 17 00:00:00 2001 From: KATO Tomoyuki Date: Wed, 21 Dec 2016 23:00:48 +0900 Subject: [PATCH] Print version information dynamically Change-Id: I10c135eb7378a30b44d24b58be3904ff000f0421 --- freezerclient/__init__.py | 17 +++++++++++++++++ freezerclient/shell.py | 3 ++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/freezerclient/__init__.py b/freezerclient/__init__.py index e69de29..f73fe00 100644 --- a/freezerclient/__init__.py +++ b/freezerclient/__init__.py @@ -0,0 +1,17 @@ +# Copyright 2012 OpenStack Foundation +# +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# 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 pbr.version + +__version__ = pbr.version.VersionInfo('python-freezerclient').version_string() diff --git a/freezerclient/shell.py b/freezerclient/shell.py index fdb63ad..fd007e7 100644 --- a/freezerclient/shell.py +++ b/freezerclient/shell.py @@ -19,6 +19,7 @@ import sys from cliff import app from cliff import commandmanager +import freezerclient from freezerclient.v1 import actions from freezerclient.v1 import backups from freezerclient.v1 import client @@ -74,7 +75,7 @@ class FreezerShell(app.App): def __init__(self): super(FreezerShell, self).__init__( description='Python Freezer Client', - version='0.1', + version=freezerclient.__version__, deferred_help=True, command_manager=FreezerCommandManager(None), )