Update tuskar.version to use PBR

Remove the stale code (it isn't 2013!) in tuskar.version and use the
common pbr.version as per other OpenStack projects.

Change-Id: I9c823a07bb94419634363ed0eae20c9805765a1e
This commit is contained in:
Dougal Matthews 2014-08-06 16:38:09 +01:00
parent df9ae60315
commit e0d6375c75
3 changed files with 14 additions and 41 deletions
doc/source
tuskar

@ -50,9 +50,9 @@ copyright = u'OpenStack Foundation'
from tuskar import version as tuskar_version
# The full version, including alpha/beta/rc tags.
release = tuskar_version.version_string_with_vcs()
release = tuskar_version.version_info.release_string()
# The short X.Y version.
version = tuskar_version.canonical_version_string()
version = tuskar_version.version_info.version_string()
# A list of ignored prefixes for module index sorting.
modindex_common_prefix = ['tuskar.']

@ -31,5 +31,5 @@ def parse_args(argv, default_config_files=None):
rpc.set_defaults(control_exchange='tuskar')
cfg.CONF(argv[1:],
project='tuskar',
version=version.version_string(),
version=version.version_info.release_string(),
default_config_files=default_config_files)

@ -1,45 +1,18 @@
# Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# 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
# 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
# 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.
# 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.
try:
from tuskar.vcsversion import version_info
except ImportError:
version_info = {'branch_nick': u'LOCALBRANCH',
'revision_id': 'LOCALREVISION',
'revno': 0}
import pbr.version
TUSKAR_VERSION = ['2013', '1']
YEAR, COUNT = TUSKAR_VERSION
FINAL = False # This becomes true at Release Candidate time
def canonical_version_string():
return '.'.join([YEAR, COUNT])
def version_string():
if FINAL:
return canonical_version_string()
else:
return '%s-dev' % (canonical_version_string(),)
def vcs_version_string():
return "%s:%s" % (version_info['branch_nick'], version_info['revision_id'])
def version_string_with_vcs():
return "%s-%s" % (canonical_version_string(), vcs_version_string())
version_info = pbr.version.VersionInfo('tuskar')