#230 Fix tracebacks when multilib_arches and multilib_method is None.
Merged 10 months ago by jkaluza. Opened 10 months ago by jkaluza.
jkaluza/odcs multilib-none  into  master

@@ -581,12 +581,16 @@ 

              pungi_cfg = RawPungiConfig(compose.source)

          else:

              # Generate PungiConfig and run Pungi

+             if compose.multilib_arches:

+                 multilib_arches = compose.multilib_arches.split(" ")

+             else:

+                 multilib_arches = None

              pungi_cfg = PungiConfig(compose.name, "1", compose.source_type,

                                      compose.source, packages=packages,

                                      sigkeys=compose.sigkeys,

                                      results=compose.results,

                                      arches=compose.arches.split(" "),

-                                     multilib_arches=compose.multilib_arches.split(" "),

+                                     multilib_arches=multilib_arches,

                                      multilib_method=compose.multilib_method)

              if compose.flags & COMPOSE_FLAGS["no_deps"]:

                  pungi_cfg.gather_method = "nodeps"

file modified
+4 -3

@@ -134,9 +134,10 @@ 

  

          self.multilib_arches = multilib_arches if multilib_arches else []

          self.multilib_method = []

-         for k, v in MULTILIB_METHODS.items():

-             if multilib_method & v:

-                 self.multilib_method.append(k)

+         if multilib_method:

+             for k, v in MULTILIB_METHODS.items():

+                 if multilib_method & v:

+                     self.multilib_method.append(k)

  

          if "boot.iso" in self.results:

              self.bootable = True

@@ -651,6 +651,18 @@ 

          self.assertEqual(set(self.pungi_config.multilib_arches), set(["i686", "x86_64"]))

          self.assertEqual(self.pungi_config.multilib_method, ["runtime"])

  

+     def test_generate_pungi_compose_multiarch_arches_None(self):

+         c = Compose.create(

+             db.session, "me", PungiSourceType.KOJI_TAG, "f26",

+             COMPOSE_RESULTS["repository"], 60, packages='pkg1 pkg2 pkg3',

+             arches="x86_64 s390", multilib_arches=None,

+             multilib_method=None)

+         c.id = 1

+ 

+         generate_pungi_compose(c)

+         self.assertEqual(set(self.pungi_config.multilib_arches), set([]))

+         self.assertEqual(self.pungi_config.multilib_method, [])

+ 

      def test_generate_pungi_compose_nodeps(self):

          c = Compose.create(

              db.session, "me", PungiSourceType.KOJI_TAG, "f26",

The multilib_arches and multilib_method can be None. Do not try to use them in this case.

Pull-Request has been merged by jkaluza

10 months ago