← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~jelmer/launchpad/600153-qafix into lp:launchpad/devel

 

Jelmer Vernooij has proposed merging lp:~jelmer/launchpad/600153-qafix into lp:launchpad/devel.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)


This fixes the qa-badness of bug 600153. process-upload was manually looking at ArchiveArch to determine what restricted architectures the archive could build on rather than checking Archive.enabled_restricted_families which looks at ArchiveArch *and* does other magic (such as whitelisting main archives).
-- 
https://code.launchpad.net/~jelmer/launchpad/600153-qafix/+merge/30790
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~jelmer/launchpad/600153-qafix into lp:launchpad/devel.
=== modified file 'lib/lp/soyuz/model/archive.py'
--- lib/lp/soyuz/model/archive.py	2010-07-18 00:56:16 +0000
+++ lib/lp/soyuz/model/archive.py	2010-07-23 15:51:00 +0000
@@ -15,10 +15,9 @@
 from sqlobject import  (
     BoolCol, ForeignKey, IntCol, StringCol)
 from sqlobject.sqlbuilder import SQLConstant
-from storm.expr import Or, And, Select, Sum, In, Desc
+from storm.expr import Or, And, Select, Sum, Desc
 from storm.locals import Count, Join
 from storm.store import Store
-from storm.zope.interfaces import IResultSet
 from zope.component import getUtility
 from zope.event import notify
 from zope.interface import alsoProvides, implements
@@ -1594,7 +1593,7 @@
     def _getEnabledRestrictedFamilies(self):
         """Retrieve the restricted architecture families this archive can
         build on."""
-        # Main archives are always allowed to build on restricted 
+        # Main archives are always allowed to build on restricted
         # architectures.
         if self.is_main:
             return getUtility(IProcessorFamilySet).getRestricted()
@@ -1606,7 +1605,7 @@
     def _setEnabledRestrictedFamilies(self, value):
         """Set the restricted architecture families this archive can
         build on."""
-        # Main archives are always allowed to build on restricted 
+        # Main archives are always allowed to build on restricted
         # architectures.
         if self.is_main:
             proc_family_set = getUtility(IProcessorFamilySet)

=== modified file 'lib/lp/soyuz/model/publishing.py'
--- lib/lp/soyuz/model/publishing.py	2010-07-21 14:14:54 +0000
+++ lib/lp/soyuz/model/publishing.py	2010-07-23 15:51:00 +0000
@@ -517,14 +517,12 @@
         :param available_archs: Architectures to consider
         :return: Sequence of `IDistroArch` instances.
         """
-        associated_proc_families = [
-            archivearch.processorfamily for archivearch
-            in getUtility(IArchiveArchSet).getByArchive(self.archive)]
         # Return all distroarches with unrestricted processor families or with
         # processor families the archive is explicitly associated with.
         return [distroarch for distroarch in available_archs
             if not distroarch.processorfamily.restricted or
-               distroarch.processorfamily in associated_proc_families]
+               distroarch.processorfamily in
+                    self.archive.enabled_restricted_families]
 
     def createMissingBuilds(self, architectures_available=None,
                             pas_verify=None, logger=None):