Access ci_base date via compose
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
This commit is contained in:
parent
a217eea24e
commit
527394707d
@ -789,7 +789,7 @@ def version_generator(compose, gen):
|
|||||||
return compose.image_release
|
return compose.image_release
|
||||||
elif gen == '!VERSION_FROM_VERSION_DATE_RESPIN':
|
elif gen == '!VERSION_FROM_VERSION_DATE_RESPIN':
|
||||||
return '%s.%s.%s' % (compose.ci_base.release.version,
|
return '%s.%s.%s' % (compose.ci_base.release.version,
|
||||||
compose.ci_base.date,
|
compose.compose_date,
|
||||||
compose.compose_respin)
|
compose.compose_respin)
|
||||||
elif gen and gen[0] == '!':
|
elif gen and gen[0] == '!':
|
||||||
raise RuntimeError("Unknown version generator '%s'" % gen)
|
raise RuntimeError("Unknown version generator '%s'" % gen)
|
||||||
|
@ -626,7 +626,6 @@ class TestVersionGenerator(unittest.TestCase):
|
|||||||
ci.respin = 0
|
ci.respin = 0
|
||||||
ci.id = 'RHEL-8.0-20180101.0'
|
ci.id = 'RHEL-8.0-20180101.0'
|
||||||
ci.release.version = '8'
|
ci.release.version = '8'
|
||||||
ci.date = '20160101'
|
|
||||||
ci.type = 'nightly'
|
ci.type = 'nightly'
|
||||||
ci.type_suffix = ''
|
ci.type_suffix = ''
|
||||||
ci.label = 'RC-1.0'
|
ci.label = 'RC-1.0'
|
||||||
@ -635,6 +634,7 @@ class TestVersionGenerator(unittest.TestCase):
|
|||||||
self.compose = mock.MagicMock()
|
self.compose = mock.MagicMock()
|
||||||
self.compose.ci_base = ci
|
self.compose.ci_base = ci
|
||||||
self.compose.compose_respin = 0
|
self.compose.compose_respin = 0
|
||||||
|
self.compose.compose_date = '20160101'
|
||||||
|
|
||||||
def test_unknown_generator(self):
|
def test_unknown_generator(self):
|
||||||
compose = mock.Mock()
|
compose = mock.Mock()
|
||||||
|
Loading…
Reference in New Issue
Block a user