Update versions.py script to support new engine versioning schema

Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
Joffrey F 2017-02-21 14:05:47 -08:00
parent aa8fb8f708
commit c2553ac777
1 changed files with 2 additions and 2 deletions

View File

@ -44,7 +44,7 @@ class Version(namedtuple('_Version', 'major minor patch rc')):
version = version.lstrip('v')
version, _, rc = version.partition('-')
major, minor, patch = version.split('.', 3)
return cls(int(major), int(minor), int(patch), rc)
return cls(major, minor, patch, rc)
@property
def major_minor(self):
@ -57,7 +57,7 @@ class Version(namedtuple('_Version', 'major minor patch rc')):
"""
# rc releases should appear before official releases
rc = (0, self.rc) if self.rc else (1, )
return (self.major, self.minor, self.patch) + rc
return (int(self.major), int(self.minor), int(self.patch)) + rc
def __str__(self):
rc = '-{}'.format(self.rc) if self.rc else ''