Update version.version_string to actually be a string

pbr provides VersionInfo.version_string() as a method to determine
the version.  mistral.version.version_string can hide this and
provide a uniform string interface to config and launch.

This fixes a problem with mistral-server --version generating
an exception because the version passed to argparse was a method
instead of a string.

Change-Id: Ie468685e4360bfaec5d82b02f8cf1a27a93bcd94
Closes-Bug: 1796921
This commit is contained in:
Bob Haddleton 2018-10-09 11:21:23 -05:00
parent b3fbb03b81
commit 488b40834f
3 changed files with 21 additions and 2 deletions

View File

@ -143,7 +143,7 @@ MISTRAL_TITLE = """
|| || || __// ||_// || \\\__// \\\_ ||
Mistral Workflow Service, version %s
""" % version.version_string()
""" % version.version_string
def print_server_info():

View File

@ -0,0 +1,19 @@
# 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.
from mistral.tests.unit import base
from mistral.version import version_string
class VersionStringTest(base.BaseTest):
def test_version(self):
self.assertIsInstance(version_string, str)

View File

@ -15,4 +15,4 @@
from pbr import version
version_info = version.VersionInfo('mistral')
version_string = version_info.version_string
version_string = version_info.version_string()