Print version information dynamically

Change-Id: I10c135eb7378a30b44d24b58be3904ff000f0421
This commit is contained in:
KATO Tomoyuki
2016-12-21 23:00:48 +09:00
parent 913ac38e2f
commit d79f44e970
2 changed files with 19 additions and 1 deletions

View File

@@ -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()

View File

@@ -19,6 +19,7 @@ import sys
from cliff import app from cliff import app
from cliff import commandmanager from cliff import commandmanager
import freezerclient
from freezerclient.v1 import actions from freezerclient.v1 import actions
from freezerclient.v1 import backups from freezerclient.v1 import backups
from freezerclient.v1 import client from freezerclient.v1 import client
@@ -74,7 +75,7 @@ class FreezerShell(app.App):
def __init__(self): def __init__(self):
super(FreezerShell, self).__init__( super(FreezerShell, self).__init__(
description='Python Freezer Client', description='Python Freezer Client',
version='0.1', version=freezerclient.__version__,
deferred_help=True, deferred_help=True,
command_manager=FreezerCommandManager(None), command_manager=FreezerCommandManager(None),
) )