From b87960426a9d791e992211c73677f58d78e56bb9 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Fri, 26 Oct 2012 11:07:26 -0400 Subject: Fix a logic error in stable version calculation. Milestone information in blank for stable branches, so there is no milestone prefix. However, we were blindly concatenating the milestone version prefix onto the datestamp. Fixes bug 1059634. Change-Id: I6cff4ee7f6c1dc970397b66fd2d15fa22b0a63a3 --- openstack/common/setup.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'openstack/common') diff --git a/openstack/common/setup.py b/openstack/common/setup.py index 4e2a577..83eef07 100644 --- a/openstack/common/setup.py +++ b/openstack/common/setup.py @@ -136,15 +136,17 @@ def _get_git_next_version_suffix(branch_name): _run_shell_command("git fetch origin +refs/meta/*:refs/remotes/meta/*") milestone_cmd = "git show meta/openstack/release:%s" % branch_name milestonever = _run_shell_command(milestone_cmd) - if not milestonever: - milestonever = "" + if milestonever: + first_half = "%s~%s" % (milestonever, datestamp) + else: + first_half = datestamp + post_version = _get_git_post_version() # post version should look like: # 0.1.1.4.gcc9e28a # where the bit after the last . is the short sha, and the bit between # the last and second to last is the revno count (revno, sha) = post_version.split(".")[-2:] - first_half = "%s~%s" % (milestonever, datestamp) second_half = "%s%s.%s" % (revno_prefix, revno, sha) return ".".join((first_half, second_half)) -- cgit