~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/soyuz/model/archive.py

[r=gmb][bug=837975] Add two fields to distro's +add and +edit pages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1910
1910
        """Retrieve the restricted architecture families this archive can
1911
1911
        build on."""
1912
1912
        # Main archives are always allowed to build on restricted
1913
 
        # architectures.
1914
 
        if self.is_main:
 
1913
        # architectures if require_virtualized is False.
 
1914
        if self.is_main and not self.require_virtualized:
1915
1915
            return getUtility(IProcessorFamilySet).getRestricted()
1916
1916
        archive_arch_set = getUtility(IArchiveArchSet)
1917
1917
        restricted_families = archive_arch_set.getRestrictedFamilies(self)
1921
1921
    def _setEnabledRestrictedFamilies(self, value):
1922
1922
        """Set the restricted architecture families this archive can
1923
1923
        build on."""
1924
 
        # Main archives are always allowed to build on restricted
1925
 
        # architectures.
1926
 
        if self.is_main:
 
1924
        # Main archives are not allowed to build on restricted
 
1925
        # architectures unless they are set to build on virtualized
 
1926
        # builders.
 
1927
        if (self.is_main and not self.require_virtualized):
1927
1928
            proc_family_set = getUtility(IProcessorFamilySet)
1928
1929
            if set(value) != set(proc_family_set.getRestricted()):
1929
 
                raise CannotRestrictArchitectures("Main archives can not "
1930
 
                        "be restricted to certain architectures")
 
1930
                raise CannotRestrictArchitectures(
 
1931
                    "Main archives can not be restricted to certain "
 
1932
                    "architectures unless they are set to build on "
 
1933
                    "virtualized builders")
1931
1934
        archive_arch_set = getUtility(IArchiveArchSet)
1932
1935
        restricted_families = archive_arch_set.getRestrictedFamilies(self)
1933
1936
        for (family, archive_arch) in restricted_families: