1
# vim: tabstop=4 shiftwidth=4 softtabstop=4
3
# Copyright 2012 OpenStack, LLC
4
# Copyright 2012, Big Switch Networks, Inc.
6
# Licensed under the Apache License, Version 2.0 (the "License"); you may
7
# not use this file except in compliance with the License. You may obtain
8
# a copy of the License at
10
# http://www.apache.org/licenses/LICENSE-2.0
12
# Unless required by applicable law or agreed to in writing, software
13
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15
# License for the specific language governing permissions and limitations
18
# Based on openstack generic code
19
# @author: Mandeep Dhami, Big Switch Networks, Inc.
21
"""Determine version of QuantumRestProxy plugin"""
23
# if vcsversion exists, use it. Else, use LOCALBRANCH:LOCALREVISION
25
from bigswitch.vcsversion import version_info
27
version_info = {'branch_nick': u'LOCALBRANCH',
28
'revision_id': u'LOCALREVISION',
32
QUANTUMRESTPROXY_VERSION = ['2012', '1', None]
33
YEAR, COUNT, REVISION = QUANTUMRESTPROXY_VERSION
34
FINAL = False # This becomes true at Release Candidate time
37
def canonical_version_string():
38
return '.'.join(filter(None, QUANTUMRESTPROXY_VERSION))
43
return canonical_version_string()
45
return '%s-dev' % (canonical_version_string(),)
48
def vcs_version_string():
49
return "%s:%s" % (version_info['branch_nick'], version_info['revision_id'])
52
def version_string_with_vcs():
53
return "%s-%s" % (canonical_version_string(), vcs_version_string())
56
if __name__ == "__main__":
57
print version_string_with_vcs()