#418 Ensure arch_override is str type
Merged 4 years ago by jkaluza. Opened 4 years ago by lucarval.
lucarval/freshmaker fix-arche_override  into  master

file modified
+8 -2
@@ -262,11 +262,17 @@ 

              if not conf.supply_arch_overrides:

                  data['arches'] = None

              else:

-                 archives = session.list_archives(build_id=build['build_id'])

-                 data['arches'] = [archive['extra']['image']['arch'] for archive in archives if archive['btype'] == 'image']

+                 data['arches'] = self._get_arches_from_koji(session, build['build_id'])

  

          return data

  

+     def _get_arches_from_koji(self, koji_session, build_id):

+         archives = koji_session.list_archives(build_id=build_id)

+         arches = [

+             archive['extra']['image']['arch']

+             for archive in archives if archive['btype'] == 'image']

+         return ' '.join(sorted(arches))

+ 

      @region.cache_on_arguments()

      def _get_additional_data_from_distgit(self, repository, branch, commit):

          """

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

          self.assertEqual(self.dummy_image["repository"], "rpms/repo-1")

          self.assertEqual(self.dummy_image["commit"], "commit_hash1")

          self.assertEqual(self.dummy_image["target"], "target1")

-         self.assertEqual(self.dummy_image["arches"], ['ppc64le', 's390x'])

+         self.assertEqual(self.dummy_image["arches"], 'ppc64le s390x')

  

      @patch('freshmaker.kojiservice.KojiService.get_build')

      @patch('freshmaker.kojiservice.KojiService.get_task_request')

The koji_containerbuild plugin requires the parameter "arch_override" to
be of type str.

Signed-off-by: Luiz Carvalho lucarval@redhat.com

Pull-Request has been merged by jkaluza

4 years ago