#910 Access ci_base date via compose
Merged 6 years ago by lsedlar. Opened 6 years ago by puiterwijk.
puiterwijk/pungi fixdate  into  master

file modified
+1 -1
@@ -789,7 +789,7 @@ 

          return compose.image_release

      elif gen == '!VERSION_FROM_VERSION_DATE_RESPIN':

          return '%s.%s.%s' % (compose.ci_base.release.version,

-                              compose.ci_base.date,

+                              compose.compose_date,

                               compose.compose_respin)

      elif gen and gen[0] == '!':

          raise RuntimeError("Unknown version generator '%s'" % gen)

file modified
+1 -1
@@ -626,7 +626,6 @@ 

          ci.respin = 0

          ci.id = 'RHEL-8.0-20180101.0'

          ci.release.version = '8'

-         ci.date = '20160101'

          ci.type = 'nightly'

          ci.type_suffix = ''

          ci.label = 'RC-1.0'
@@ -635,6 +634,7 @@ 

          self.compose = mock.MagicMock()

          self.compose.ci_base = ci

          self.compose.compose_respin = 0

+         self.compose.compose_date = '20160101'

  

      def test_unknown_generator(self):

          compose = mock.Mock()

rebased onto f1b83c4a99d124c30de4b03d44038be64590b247

6 years ago

rebased onto 35e78130c91c478e86b8f5c2abcac34735aae0cb

6 years ago

rebased onto 5273947

6 years ago

Looks good. Did you run into some problems with the original code?

Pull-Request has been merged by lsedlar

6 years ago

Yes, the ComposeInfo object doesn't have a date property. It worked in the tests because it's mocked there.