diff options
author | Jeff Peeler <jpeeler@redhat.com> | 2012-12-06 17:15:05 -0500 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2012-12-08 02:24:03 +0000 |
commit | 4e99d4d0bb4ed4dc6bea9330a63ab53975b3ebf6 (patch) | |
tree | 345053e9c3a910d493a0e91e1a9b9a28726e39a5 /heat/version.py | |
parent | 42599700a75b1b6b4d65707209a08df3ef35b73d (diff) | |
download | heat-4e99d4d0bb4ed4dc6bea9330a63ab53975b3ebf6.tar.gz |
Switch to openstack style versioning
Bug 1078480
Change-Id: I32471acc16e7ca6f60672474c9bf70537ba76fd2
Signed-off-by: Jeff Peeler <jpeeler@redhat.com>
Diffstat (limited to 'heat/version.py')
-rw-r--r-- | heat/version.py | 55 |
1 files changed, 3 insertions, 52 deletions
diff --git a/heat/version.py b/heat/version.py index 4f67db11f..cfb415bea 100644 --- a/heat/version.py +++ b/heat/version.py @@ -13,57 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. -import os -try: - import git -except ImportError: - git = None +from heat.openstack.common import version as common_version -try: - from heat.vcsversion import version_info -except ImportError: - version_info = {} - -HEAT_VERSION = '8' -FINAL = False # This becomes true at Release Candidate time - - -def get_git_sha(): - if not git: - return version_info.get('sha', '') - - try: - repo = git.Repo('.') - except git.InvalidGitRepositoryError: - return version_info.get('sha', '') - return repo.head.commit.hexsha - - -def write_git_sha(): - - sha = get_git_sha() - vcsversion_path = 'heat/vcsversion.py' - - if sha: - with open(vcsversion_path, 'w') as version_file: - version_file.write(""" -# This file is automatically generated by heat's setup.py, so don't edit it. :) -version_info = { - 'sha': '%s' -} -""" % (sha)) - else: - try: - os.remove(vcsversion_path) - except OSError: - pass - - -def version_string(type='short'): - version = HEAT_VERSION - if not FINAL: - version += '-dev ' + get_git_sha() - elif type != 'short': - version += ' ' + get_git_sha() - return version +NEXT_VERSION = '2013.1' +version_info = common_version.VersionInfo('heat', pre_version=NEXT_VERSION) |