Use label to populate image release

When release for an image is specified as explicit `None`, we can
generate the value based on compose label. For example for `Alpha-1.2`
the release would be `1.2` instead of the date based one.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2016-08-25 15:22:55 +02:00
parent d90dba9312
commit 43fda1e9ef
2 changed files with 24 additions and 2 deletions

View file

@ -344,7 +344,14 @@ class Compose(kobo.log.LoggingBase):
@property
def image_release(self):
"""Generate a value to pass to Koji as image release. This includes
date, compose type and respin."""
"""Generate a value to pass to Koji as image release.
If this compose has a label, the version from it will be used,
otherwise we will create a string with date, compose type and respin.
"""
if self.compose_label:
milestone, release = self.compose_label.split('-')
return release
return '%s%s.%s' % (self.compose_date, self.ci_base.compose.type_suffix,
self.compose_respin)