Merge lp:~stevenk/launchpad/destroy-pf into lp:launchpad
- destroy-pf
- Merge into devel
Proposed by
Steve Kowalik
Status: | Merged |
---|---|
Approved by: | William Grant |
Approved revision: | no longer in the source branch. |
Merged at revision: | 16776 |
Proposed branch: | lp:~stevenk/launchpad/destroy-pf |
Merge into: | lp:launchpad |
Prerequisite: | lp:~stevenk/launchpad/switch-to-processor |
Diff against target: |
4049 lines (+577/-1117) 83 files modified
lib/lp/_schema_circular_imports.py (+1/-11) lib/lp/app/browser/launchpad.py (+1/-5) lib/lp/archivepublisher/tests/test_dominator.py (+1/-1) lib/lp/archivepublisher/tests/test_generate_contents_files.py (+1/-1) lib/lp/archiveuploader/tests/test_buildduploads.py (+4/-9) lib/lp/buildmaster/doc/builder.txt (+4/-4) lib/lp/buildmaster/tests/test_buildfarmjobbehavior.py (+3/-3) lib/lp/buildmaster/tests/test_buildqueue.py (+11/-15) lib/lp/buildmaster/tests/test_interactor.py (+2/-3) lib/lp/buildmaster/tests/test_webservice.py (+4/-5) lib/lp/code/browser/tests/test_sourcepackagerecipe.py (+6/-6) lib/lp/code/browser/tests/test_sourcepackagerecipebuild.py (+3/-3) lib/lp/code/model/tests/test_recipebuilder.py (+7/-7) lib/lp/code/model/tests/test_sourcepackagerecipebuild.py (+2/-2) lib/lp/hardwaredb/doc/hwdb.txt (+3/-3) lib/lp/registry/browser/distribution.py (+27/-29) lib/lp/registry/browser/tests/distribution-views.txt (+1/-1) lib/lp/registry/browser/tests/test_distribution_views.py (+29/-34) lib/lp/registry/doc/distroseries.txt (+2/-2) lib/lp/registry/interfaces/distroseries.py (+1/-1) lib/lp/registry/model/distroseries.py (+4/-6) lib/lp/registry/stories/distribution/xx-distribution-launchpad-usage.txt (+7/-1) lib/lp/registry/tests/test_distroseries.py (+9/-11) lib/lp/services/webservice/wadl-to-refhtml.xsl (+0/-4) lib/lp/soyuz/adapters/tests/test_buildarch.py (+4/-5) lib/lp/soyuz/browser/archive.py (+15/-15) lib/lp/soyuz/browser/configure.zcml (+1/-8) lib/lp/soyuz/browser/distroarchseries.py (+3/-3) lib/lp/soyuz/browser/processor.py (+2/-20) lib/lp/soyuz/browser/tests/test_archive_webservice.py (+26/-64) lib/lp/soyuz/browser/tests/test_processor.py (+4/-18) lib/lp/soyuz/browser/tests/test_publishing.py (+3/-4) lib/lp/soyuz/configure.zcml (+1/-15) lib/lp/soyuz/doc/distroarchseries.txt (+6/-6) lib/lp/soyuz/doc/distroseriesqueue-translations.txt (+3/-2) lib/lp/soyuz/doc/gina-multiple-arch.txt (+17/-36) lib/lp/soyuz/doc/gina.txt (+7/-7) lib/lp/soyuz/doc/processor.txt (+0/-39) lib/lp/soyuz/doc/soyuz-set-of-uploads.txt (+4/-6) lib/lp/soyuz/interfaces/archive.py (+9/-9) lib/lp/soyuz/interfaces/archivearch.py (+17/-26) lib/lp/soyuz/interfaces/distroarchseries.py (+1/-10) lib/lp/soyuz/interfaces/packagecloner.py (+2/-3) lib/lp/soyuz/interfaces/processor.py (+7/-102) lib/lp/soyuz/interfaces/webservice.py (+0/-4) lib/lp/soyuz/model/archive.py (+16/-28) lib/lp/soyuz/model/archivearch.py (+8/-12) lib/lp/soyuz/model/distroarchseries.py (+2/-21) lib/lp/soyuz/model/packagecloner.py (+15/-20) lib/lp/soyuz/model/processor.py (+9/-60) lib/lp/soyuz/scripts/gina/handlers.py (+1/-9) lib/lp/soyuz/scripts/initialize_distroseries.py (+8/-9) lib/lp/soyuz/scripts/populate_archive.py (+26/-33) lib/lp/soyuz/scripts/tests/test_copypackage.py (+3/-3) lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py (+12/-11) lib/lp/soyuz/scripts/tests/test_populatearchive.py (+6/-6) lib/lp/soyuz/security.py (+1/-10) lib/lp/soyuz/stories/distroseries/add-architecture.txt (+2/-2) lib/lp/soyuz/stories/ppa/xx-copy-packages.txt (+2/-2) lib/lp/soyuz/stories/soyuz/xx-distroarchseries.txt (+4/-4) lib/lp/soyuz/stories/webservice/xx-archive.txt (+0/-1) lib/lp/soyuz/stories/webservice/xx-distroarchseries.txt (+2/-2) lib/lp/soyuz/templates/distroarchseries-portlet-details.pt (+2/-2) lib/lp/soyuz/tests/test_archive.py (+21/-19) lib/lp/soyuz/tests/test_archivearch.py (+12/-22) lib/lp/soyuz/tests/test_binarypackagebuild.py (+1/-8) lib/lp/soyuz/tests/test_build.py (+5/-6) lib/lp/soyuz/tests/test_build_depwait.py (+3/-4) lib/lp/soyuz/tests/test_build_notify.py (+3/-4) lib/lp/soyuz/tests/test_build_privacy.py (+3/-4) lib/lp/soyuz/tests/test_build_set.py (+8/-11) lib/lp/soyuz/tests/test_build_start_estimation.py (+1/-2) lib/lp/soyuz/tests/test_buildpackagejob.py (+4/-5) lib/lp/soyuz/tests/test_hasbuildrecords.py (+12/-21) lib/lp/soyuz/tests/test_initializedistroseriesjob.py (+12/-10) lib/lp/soyuz/tests/test_packagecloner.py (+57/-57) lib/lp/soyuz/tests/test_processor.py (+17/-51) lib/lp/soyuz/tests/test_publishing.py (+12/-14) lib/lp/soyuz/tests/test_sourcepackagerelease.py (+1/-1) lib/lp/soyuz/vocabularies.py (+1/-11) lib/lp/soyuz/vocabularies.zcml (+0/-13) lib/lp/testing/factory.py (+15/-45) utilities/soyuz-sampledata-setup.py (+5/-5) |
To merge this branch: | bzr merge lp:~stevenk/launchpad/destroy-pf |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
William Grant | code | Approve | |
Review via email: mp+187645@code.launchpad.net |
Commit message
Drop ProcessorFamily's interfaces, model code and switch to using processor everywhere.
Description of the change
Now we can destroy ProcessorFamily from the model, the API and pretty much everywhere but the DB. Switches all references to using processors.
To post a comment you must log in.
Revision history for this message
William Grant (wgrant) : | # |
review:
Approve
(code)
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'lib/lp/_schema_circular_imports.py' |
2 | --- lib/lp/_schema_circular_imports.py 2013-09-13 07:07:25 +0000 |
3 | +++ lib/lp/_schema_circular_imports.py 2013-09-26 04:04:44 +0000 |
4 | @@ -200,10 +200,7 @@ |
5 | IPackageset, |
6 | IPackagesetSet, |
7 | ) |
8 | -from lp.soyuz.interfaces.processor import ( |
9 | - IProcessorFamily, |
10 | - IProcessor, |
11 | - ) |
12 | +from lp.soyuz.interfaces.processor import IProcessor |
13 | from lp.soyuz.interfaces.publishing import ( |
14 | IBinaryPackagePublishingHistory, |
15 | IBinaryPackagePublishingHistoryEdit, |
16 | @@ -395,8 +392,6 @@ |
17 | patch_reference_property(IArchive, 'distribution', IDistribution) |
18 | patch_collection_property(IArchive, 'dependencies', IArchiveDependency) |
19 | patch_collection_property( |
20 | - IArchive, 'enabled_restricted_families', IProcessorFamily) |
21 | -patch_collection_property( |
22 | IArchive, 'enabled_restricted_processors', IProcessor) |
23 | patch_collection_return_type(IArchive, 'getAllPermissions', IArchivePermission) |
24 | patch_collection_return_type( |
25 | @@ -496,13 +491,8 @@ |
26 | patch_entry_return_type( |
27 | IArchive, '_addArchiveDependency', IArchiveDependency) |
28 | patch_plain_parameter_type( |
29 | - IArchive, 'enableRestrictedFamily', 'family', IProcessorFamily) |
30 | -patch_plain_parameter_type( |
31 | IArchive, 'enableRestrictedProcessor', 'processor', IProcessor) |
32 | |
33 | -# IProcessor |
34 | -patch_reference_property(IProcessor, 'family', IProcessorFamily) |
35 | - |
36 | # IBuildFarmJob |
37 | IBuildFarmJob['status'].vocabulary = BuildStatus |
38 | IBuildFarmJob['buildqueue_record'].schema = IBuildQueue |
39 | |
40 | === modified file 'lib/lp/app/browser/launchpad.py' |
41 | --- lib/lp/app/browser/launchpad.py 2013-04-09 08:22:58 +0000 |
42 | +++ lib/lp/app/browser/launchpad.py 2013-09-26 04:04:44 +0000 |
43 | @@ -145,10 +145,7 @@ |
44 | from lp.services.worlddata.interfaces.language import ILanguageSet |
45 | from lp.soyuz.interfaces.binarypackagename import IBinaryPackageNameSet |
46 | from lp.soyuz.interfaces.packageset import IPackagesetSet |
47 | -from lp.soyuz.interfaces.processor import ( |
48 | - IProcessorFamilySet, |
49 | - IProcessorSet, |
50 | - ) |
51 | +from lp.soyuz.interfaces.processor import IProcessorSet |
52 | from lp.testopenid.interfaces.server import ITestOpenIDApplication |
53 | from lp.translations.interfaces.translationgroup import ITranslationGroupSet |
54 | from lp.translations.interfaces.translationimportqueue import ( |
55 | @@ -679,7 +676,6 @@ |
56 | 'package-sets': IPackagesetSet, |
57 | 'people': IPersonSet, |
58 | 'pillars': IPillarNameSet, |
59 | - '+processor-families': IProcessorFamilySet, |
60 | '+processors': IProcessorSet, |
61 | 'projects': IProductSet, |
62 | 'projectgroups': IProjectGroupSet, |
63 | |
64 | === modified file 'lib/lp/archivepublisher/tests/test_dominator.py' |
65 | --- lib/lp/archivepublisher/tests/test_dominator.py 2013-05-23 07:06:42 +0000 |
66 | +++ lib/lp/archivepublisher/tests/test_dominator.py 2013-09-26 04:04:44 +0000 |
67 | @@ -999,7 +999,7 @@ |
68 | distribution=das.distroseries.distribution) |
69 | other_das = self.factory.makeDistroArchSeries( |
70 | distroseries=other_series, architecturetag=das.architecturetag, |
71 | - processorfamily=das.processorfamily) |
72 | + processor=das.processor) |
73 | self.assertContentEqual( |
74 | [], dominator.findBinariesForDomination( |
75 | other_das, bpphs[0].pocket)) |
76 | |
77 | === modified file 'lib/lp/archivepublisher/tests/test_generate_contents_files.py' |
78 | --- lib/lp/archivepublisher/tests/test_generate_contents_files.py 2012-11-10 02:25:07 +0000 |
79 | +++ lib/lp/archivepublisher/tests/test_generate_contents_files.py 2013-09-26 04:04:44 +0000 |
80 | @@ -273,7 +273,7 @@ |
81 | distroseries = self.factory.makeDistroSeries(distribution=distro) |
82 | processor = self.factory.makeProcessor() |
83 | das = self.factory.makeDistroArchSeries( |
84 | - distroseries=distroseries, processorfamily=processor.family) |
85 | + distroseries=distroseries, processor=processor) |
86 | package = self.factory.makeSuiteSourcePackage(distroseries) |
87 | self.factory.makeSourcePackagePublishingHistory( |
88 | distroseries=distroseries, pocket=package.pocket) |
89 | |
90 | === modified file 'lib/lp/archiveuploader/tests/test_buildduploads.py' |
91 | --- lib/lp/archiveuploader/tests/test_buildduploads.py 2012-07-03 11:01:01 +0000 |
92 | +++ lib/lp/archiveuploader/tests/test_buildduploads.py 2013-09-26 04:04:44 +0000 |
93 | @@ -20,12 +20,9 @@ |
94 | PackagePublishingStatus, |
95 | PackageUploadStatus, |
96 | ) |
97 | +from lp.soyuz.interfaces.processor import IProcessorSet |
98 | from lp.soyuz.interfaces.publishing import IPublishingSet |
99 | from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
100 | -from lp.soyuz.model.processor import ( |
101 | - Processor, |
102 | - ProcessorFamily, |
103 | - ) |
104 | from lp.testing.gpgkeys import import_public_test_keys |
105 | |
106 | |
107 | @@ -181,12 +178,10 @@ |
108 | """Extend breezy setup to enable uploads to powerpc architecture.""" |
109 | TestStagedBinaryUploadBase.setupBreezy(self) |
110 | self.switchToAdmin() |
111 | - ppc_family = ProcessorFamily.selectOneBy(name='powerpc') |
112 | - Processor( |
113 | - name='powerpc', title='PowerPC', description='not yet', |
114 | - family=ppc_family) |
115 | + ppc = getUtility(IProcessorSet).new( |
116 | + name='powerpc', title='PowerPC', description='not yet') |
117 | self.breezy.newArch( |
118 | - 'powerpc', ppc_family, True, self.breezy.owner) |
119 | + 'powerpc', ppc, True, self.breezy.owner) |
120 | self.switchToUploader() |
121 | |
122 | def setUp(self): |
123 | |
124 | === modified file 'lib/lp/buildmaster/doc/builder.txt' |
125 | --- lib/lp/buildmaster/doc/builder.txt 2013-08-27 06:46:28 +0000 |
126 | +++ lib/lp/buildmaster/doc/builder.txt 2013-09-26 04:04:44 +0000 |
127 | @@ -149,9 +149,9 @@ |
128 | >>> print recipe_bq.processor |
129 | None |
130 | |
131 | - >>> from lp.soyuz.interfaces.processor import IProcessorFamilySet |
132 | - >>> i386_family = getUtility(IProcessorFamilySet).getByName('x86') |
133 | - >>> recipe_bq.processor = i386_family.processors[0] |
134 | + >>> from lp.soyuz.interfaces.processor import IProcessorSet |
135 | + >>> i386_processor = getUtility(IProcessorSet).getByName('386') |
136 | + >>> recipe_bq.processor = i386_processor |
137 | >>> recipe_bq.virtualized = True |
138 | >>> transaction.commit() |
139 | |
140 | @@ -164,7 +164,7 @@ |
141 | |
142 | >>> recipe_bq = factory.makeSourcePackageRecipeBuildJob() |
143 | >>> recipe_bq.virtualized = None |
144 | - >>> recipe_bq.processor = i386_family.processors[0] |
145 | + >>> recipe_bq.processor = i386_processor |
146 | >>> transaction.commit() |
147 | >>> queue_sizes = builderset.getBuildQueueSizes() |
148 | |
149 | |
150 | === modified file 'lib/lp/buildmaster/tests/test_buildfarmjobbehavior.py' |
151 | --- lib/lp/buildmaster/tests/test_buildfarmjobbehavior.py 2013-09-18 04:57:10 +0000 |
152 | +++ lib/lp/buildmaster/tests/test_buildfarmjobbehavior.py 2013-09-26 04:04:44 +0000 |
153 | @@ -24,7 +24,7 @@ |
154 | from lp.buildmaster.tests.mock_slaves import WaitingSlave |
155 | from lp.registry.interfaces.pocket import PackagePublishingPocket |
156 | from lp.services.config import config |
157 | -from lp.soyuz.interfaces.processor import IProcessorFamilySet |
158 | +from lp.soyuz.interfaces.processor import IProcessorSet |
159 | from lp.testing import TestCaseWithFactory |
160 | from lp.testing.factory import LaunchpadObjectFactory |
161 | from lp.testing.fakemethod import FakeMethod |
162 | @@ -55,9 +55,9 @@ |
163 | |
164 | def _makeBuild(self): |
165 | """Create a `Build` object.""" |
166 | - x86 = getUtility(IProcessorFamilySet).getByName('x86') |
167 | + x86 = getUtility(IProcessorSet).getByName('386') |
168 | distroarchseries = self.factory.makeDistroArchSeries( |
169 | - architecturetag='x86', processorfamily=x86) |
170 | + architecturetag='x86', processor=x86) |
171 | distroseries = distroarchseries.distroseries |
172 | archive = self.factory.makeArchive( |
173 | distribution=distroseries.distribution) |
174 | |
175 | === modified file 'lib/lp/buildmaster/tests/test_buildqueue.py' |
176 | --- lib/lp/buildmaster/tests/test_buildqueue.py 2013-09-02 08:11:58 +0000 |
177 | +++ lib/lp/buildmaster/tests/test_buildqueue.py 2013-09-26 04:04:44 +0000 |
178 | @@ -35,7 +35,7 @@ |
179 | PackagePublishingStatus, |
180 | ) |
181 | from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
182 | -from lp.soyuz.model.processor import ProcessorFamilySet |
183 | +from lp.soyuz.interfaces.processor import IProcessorSet |
184 | from lp.soyuz.tests.test_publishing import SoyuzTestPublisher |
185 | from lp.testing import TestCaseWithFactory |
186 | from lp.testing.fakemethod import FakeMethod |
187 | @@ -188,12 +188,11 @@ |
188 | (estimate.seconds, delay_in_seconds)) |
189 | |
190 | |
191 | -def disable_builders(test, processor, virtualized): |
192 | +def disable_builders(test, processor_name, virtualized): |
193 | """Disable bulders with the given processor and virtualization setting.""" |
194 | - if processor is not None: |
195 | - processor_fam = ProcessorFamilySet().getByName(processor) |
196 | - processor = processor_fam.processors[0].id |
197 | - for builder in test.builders[(processor, virtualized)]: |
198 | + if processor_name is not None: |
199 | + processor = getUtility(IProcessorSet).getByName(processor_name) |
200 | + for builder in test.builders[(processor.id, virtualized)]: |
201 | builder.builderok = False |
202 | |
203 | |
204 | @@ -219,8 +218,7 @@ |
205 | self.i9 = self.factory.makeBuilder(name='i386-n-9', virtualized=False) |
206 | |
207 | # Next make seven 'hppa' builders. |
208 | - processor_fam = ProcessorFamilySet().getByName('hppa') |
209 | - self.hppa_proc = processor_fam.processors[0] |
210 | + self.hppa_proc = getUtility(IProcessorSet).getByName('hppa') |
211 | self.h1 = self.factory.makeBuilder( |
212 | name='hppa-v-1', processor=self.hppa_proc) |
213 | self.h2 = self.factory.makeBuilder( |
214 | @@ -237,8 +235,7 @@ |
215 | name='hppa-n-7', processor=self.hppa_proc, virtualized=False) |
216 | |
217 | # Finally make five 'amd64' builders. |
218 | - processor_fam = ProcessorFamilySet().getByName('amd64') |
219 | - self.amd_proc = processor_fam.processors[0] |
220 | + self.amd_proc = getUtility(IProcessorSet).getByName('amd64') |
221 | self.a1 = self.factory.makeBuilder( |
222 | name='amd64-v-1', processor=self.amd_proc) |
223 | self.a2 = self.factory.makeBuilder( |
224 | @@ -251,8 +248,7 @@ |
225 | name='amd64-n-5', processor=self.amd_proc, virtualized=False) |
226 | |
227 | self.builders = dict() |
228 | - processor_fam = ProcessorFamilySet().getByName('x86') |
229 | - self.x86_proc = processor_fam.processors[0] |
230 | + self.x86_proc = getUtility(IProcessorSet).getByName('386') |
231 | # x86 native |
232 | self.builders[(self.x86_proc.id, False)] = [ |
233 | self.i6, self.i7, self.i8, self.i9] |
234 | @@ -1318,7 +1314,7 @@ |
235 | def test_no_builder_no_estimate(self): |
236 | # No dispatch estimate is provided in the absence of builders that |
237 | # can run the job of interest (JOI). |
238 | - disable_builders(self, 'x86', True) |
239 | + disable_builders(self, '386', True) |
240 | vim_build, vim_job = find_job(self, 'vim', '386') |
241 | check_estimate(self, vim_job, None) |
242 | |
243 | @@ -1326,7 +1322,7 @@ |
244 | # Test that a reduced builder pool results in longer dispatch time |
245 | # estimates. |
246 | vim_build, vim_job = find_job(self, 'vim', '386') |
247 | - disable_builders(self, 'x86', True) |
248 | + disable_builders(self, '386', True) |
249 | # Re-enable one builder. |
250 | builder = self.builders[(self.x86_proc.id, True)][0] |
251 | builder.builderok = True |
252 | @@ -1355,7 +1351,7 @@ |
253 | |
254 | def test_estimation_binary_virtual_headjob(self): |
255 | # The head job only waits for the next builder to become available. |
256 | - disable_builders(self, 'x86', True) |
257 | + disable_builders(self, '386', True) |
258 | # Re-enable one builder. |
259 | builder = self.builders[(self.x86_proc.id, True)][0] |
260 | builder.builderok = True |
261 | |
262 | === modified file 'lib/lp/buildmaster/tests/test_interactor.py' |
263 | --- lib/lp/buildmaster/tests/test_interactor.py 2013-09-25 08:41:32 +0000 |
264 | +++ lib/lp/buildmaster/tests/test_interactor.py 2013-09-26 04:04:44 +0000 |
265 | @@ -309,15 +309,14 @@ |
266 | self.assertEqual(behavior._slave, interactor.slave) |
267 | |
268 | def _setupBuilder(self): |
269 | - pf = self.factory.makeProcessorFamily(name="i386") |
270 | - processor = pf.processors[0] |
271 | + processor = self.factory.makeProcessor(name="i386") |
272 | builder = self.factory.makeBuilder( |
273 | processor=processor, virtualized=True, vm_host="bladh") |
274 | self.patch(BuilderSlave, 'makeBuilderSlave', FakeMethod(OkSlave())) |
275 | distroseries = self.factory.makeDistroSeries() |
276 | das = self.factory.makeDistroArchSeries( |
277 | distroseries=distroseries, architecturetag="i386", |
278 | - processorfamily=pf) |
279 | + processor=processor) |
280 | chroot = self.factory.makeLibraryFileAlias(db_only=True) |
281 | das.addOrUpdateChroot(chroot) |
282 | distroseries.nominatedarchindep = das |
283 | |
284 | === modified file 'lib/lp/buildmaster/tests/test_webservice.py' |
285 | --- lib/lp/buildmaster/tests/test_webservice.py 2012-01-01 02:58:52 +0000 |
286 | +++ lib/lp/buildmaster/tests/test_webservice.py 2013-09-26 04:04:44 +0000 |
287 | @@ -29,8 +29,8 @@ |
288 | ['nonvirt', 'virt'], sorted(results.jsonBody().keys())) |
289 | |
290 | def test_getBuildersForQueue(self): |
291 | - g1 = self.factory.makeProcessorFamily('g1').processors[0] |
292 | - quantum = self.factory.makeProcessorFamily('quantum').processors[0] |
293 | + g1 = self.factory.makeProcessor('g1') |
294 | + quantum = self.factory.makeProcessor('quantum') |
295 | self.factory.makeBuilder( |
296 | processor=quantum, name='quantum_builder1') |
297 | self.factory.makeBuilder( |
298 | @@ -58,9 +58,8 @@ |
299 | self.webservice = LaunchpadWebServiceCaller() |
300 | |
301 | def test_exports_processor(self): |
302 | - processor_family = self.factory.makeProcessorFamily('s1') |
303 | - builder = self.factory.makeBuilder( |
304 | - processor=processor_family.processors[0]) |
305 | + processor = self.factory.makeProcessor('s1') |
306 | + builder = self.factory.makeBuilder(processor=processor) |
307 | |
308 | logout() |
309 | entry = self.webservice.get( |
310 | |
311 | === modified file 'lib/lp/code/browser/tests/test_sourcepackagerecipe.py' |
312 | --- lib/lp/code/browser/tests/test_sourcepackagerecipe.py 2013-08-22 04:30:39 +0000 |
313 | +++ lib/lp/code/browser/tests/test_sourcepackagerecipe.py 2013-09-26 04:04:44 +0000 |
314 | @@ -45,7 +45,7 @@ |
315 | from lp.services.webapp.escaping import html_escape |
316 | from lp.services.webapp.interfaces import ILaunchpadRoot |
317 | from lp.services.webapp.servers import LaunchpadTestRequest |
318 | -from lp.soyuz.model.processor import ProcessorFamily |
319 | +from lp.soyuz.interfaces.processor import IProcessorSet |
320 | from lp.testing import ( |
321 | admin_logged_in, |
322 | ANONYMOUS, |
323 | @@ -105,8 +105,8 @@ |
324 | distribution=self.ppa.distribution) |
325 | naked_squirrel = removeSecurityProxy(self.squirrel) |
326 | naked_squirrel.nominatedarchindep = self.squirrel.newArch( |
327 | - 'i386', ProcessorFamily.get(1), False, self.chef, |
328 | - supports_virtualized=True) |
329 | + 'i386', getUtility(IProcessorSet).getByName('386'), False, |
330 | + self.chef, supports_virtualized=True) |
331 | |
332 | def makeRecipe(self): |
333 | """Create and return a specific recipe.""" |
334 | @@ -1507,8 +1507,8 @@ |
335 | name='woody', displayname='Woody', |
336 | distribution=self.ppa.distribution) |
337 | removeSecurityProxy(woody).nominatedarchindep = woody.newArch( |
338 | - 'i386', ProcessorFamily.get(1), False, self.factory.makePerson(), |
339 | - supports_virtualized=True) |
340 | + 'i386', getUtility(IProcessorSet).getByName('386'), False, |
341 | + self.factory.makePerson(), supports_virtualized=True) |
342 | return woody |
343 | |
344 | def test_request_build_rejects_over_quota(self): |
345 | @@ -1734,7 +1734,7 @@ |
346 | distroarchseries = self.factory.makeDistroArchSeries( |
347 | architecturetag=architecturetag, |
348 | distroseries=release.upload_distroseries, |
349 | - processorfamily=self.factory.makeProcessorFamily()) |
350 | + processor=self.factory.makeProcessor()) |
351 | return self.factory.makeBinaryPackageBuild( |
352 | source_package_release=release, distroarchseries=distroarchseries) |
353 | |
354 | |
355 | === modified file 'lib/lp/code/browser/tests/test_sourcepackagerecipebuild.py' |
356 | --- lib/lp/code/browser/tests/test_sourcepackagerecipebuild.py 2013-01-23 10:16:18 +0000 |
357 | +++ lib/lp/code/browser/tests/test_sourcepackagerecipebuild.py 2013-09-26 04:04:44 +0000 |
358 | @@ -15,7 +15,7 @@ |
359 | from lp.buildmaster.enums import BuildStatus |
360 | from lp.registry.interfaces.person import IPersonSet |
361 | from lp.services.webapp import canonical_url |
362 | -from lp.soyuz.model.processor import ProcessorFamily |
363 | +from lp.soyuz.interfaces.processor import IProcessorSet |
364 | from lp.testing import ( |
365 | admin_logged_in, |
366 | ANONYMOUS, |
367 | @@ -69,8 +69,8 @@ |
368 | distribution=self.ppa.distribution) |
369 | naked_squirrel = removeSecurityProxy(self.squirrel) |
370 | naked_squirrel.nominatedarchindep = self.squirrel.newArch( |
371 | - 'i386', ProcessorFamily.get(1), False, self.chef, |
372 | - supports_virtualized=True) |
373 | + 'i386', getUtility(IProcessorSet).getByName('386'), False, |
374 | + self.chef, supports_virtualized=True) |
375 | |
376 | def makeRecipeBuild(self): |
377 | """Create and return a specific recipe.""" |
378 | |
379 | === modified file 'lib/lp/code/model/tests/test_recipebuilder.py' |
380 | --- lib/lp/code/model/tests/test_recipebuilder.py 2013-09-18 06:38:31 +0000 |
381 | +++ lib/lp/code/model/tests/test_recipebuilder.py 2013-09-26 04:04:44 +0000 |
382 | @@ -9,6 +9,8 @@ |
383 | import tempfile |
384 | from textwrap import dedent |
385 | |
386 | +from zope.component import getUtility |
387 | + |
388 | from testtools import run_test_with |
389 | from testtools.deferredruntest import ( |
390 | assert_fails_with, |
391 | @@ -47,7 +49,7 @@ |
392 | from lp.soyuz.adapters.archivedependencies import ( |
393 | get_sources_list_for_building, |
394 | ) |
395 | -from lp.soyuz.model.processor import ProcessorFamilySet |
396 | +from lp.soyuz.interfaces.processor import IProcessorSet |
397 | from lp.soyuz.tests.test_publishing import SoyuzTestPublisher |
398 | from lp.testing import ( |
399 | person_logged_in, |
400 | @@ -69,9 +71,9 @@ |
401 | distro = self.factory.makeDistribution(name="distro") |
402 | distroseries = self.factory.makeDistroSeries(name="mydistro", |
403 | distribution=distro) |
404 | - processorfamily = ProcessorFamilySet().getByProcessorName('386') |
405 | + processor = getUtility(IProcessorSet).getByName('386') |
406 | distroseries.newArch( |
407 | - 'i386', processorfamily, True, self.factory.makePerson()) |
408 | + 'i386', processor, True, self.factory.makePerson()) |
409 | sourcepackage = self.factory.makeSourcePackage(spn, distroseries) |
410 | if recipe_registrant is None: |
411 | recipe_registrant = self.factory.makePerson( |
412 | @@ -302,8 +304,7 @@ |
413 | test_publisher.addFakeChroots(job.build.distroseries) |
414 | slave = OkSlave() |
415 | builder = MockBuilder("bob-de-bouwer") |
416 | - processorfamily = ProcessorFamilySet().getByProcessorName('386') |
417 | - builder.processor = processorfamily.processors[0] |
418 | + builder.processor = getUtility(IProcessorSet).getByName('386') |
419 | job.setBuilder(builder, slave) |
420 | logger = BufferLogger() |
421 | d = defer.maybeDeferred(job.dispatchBuildToSlave, "someid", logger) |
422 | @@ -333,8 +334,7 @@ |
423 | job = self.makeJob() |
424 | #test_publisher = SoyuzTestPublisher() |
425 | builder = MockBuilder("bob-de-bouwer") |
426 | - processorfamily = ProcessorFamilySet().getByProcessorName('386') |
427 | - builder.processor = processorfamily.processors[0] |
428 | + builder.processor = getUtility(IProcessorSet).getByName('386') |
429 | job.setBuilder(builder, OkSlave()) |
430 | logger = BufferLogger() |
431 | d = defer.maybeDeferred(job.dispatchBuildToSlave, "someid", logger) |
432 | |
433 | === modified file 'lib/lp/code/model/tests/test_sourcepackagerecipebuild.py' |
434 | --- lib/lp/code/model/tests/test_sourcepackagerecipebuild.py 2013-09-24 05:39:39 +0000 |
435 | +++ lib/lp/code/model/tests/test_sourcepackagerecipebuild.py 2013-09-26 04:04:44 +0000 |
436 | @@ -37,7 +37,7 @@ |
437 | from lp.services.log.logger import BufferLogger |
438 | from lp.services.mail.sendmail import format_address |
439 | from lp.services.webapp.authorization import check_permission |
440 | -from lp.soyuz.model.processor import ProcessorFamily |
441 | +from lp.soyuz.interfaces.processor import IProcessorSet |
442 | from lp.testing import ( |
443 | ANONYMOUS, |
444 | login, |
445 | @@ -62,7 +62,7 @@ |
446 | person = self.factory.makePerson() |
447 | distroseries = self.factory.makeDistroSeries() |
448 | distroseries_i386 = distroseries.newArch( |
449 | - 'i386', ProcessorFamily.get(1), False, person, |
450 | + 'i386', getUtility(IProcessorSet).getByName('386'), False, person, |
451 | supports_virtualized=True) |
452 | removeSecurityProxy(distroseries).nominatedarchindep = ( |
453 | distroseries_i386) |
454 | |
455 | === modified file 'lib/lp/hardwaredb/doc/hwdb.txt' |
456 | --- lib/lp/hardwaredb/doc/hwdb.txt 2012-04-10 14:01:17 +0000 |
457 | +++ lib/lp/hardwaredb/doc/hwdb.txt 2013-09-26 04:04:44 +0000 |
458 | @@ -717,11 +717,11 @@ |
459 | |
460 | It is also possible to search for a distroseries and architecture. |
461 | |
462 | - >>> from lp.soyuz.interfaces.processor import IProcessorFamilySet |
463 | - >>> amd64 = getUtility(IProcessorFamilySet).getByName('amd64') |
464 | + >>> from lp.soyuz.interfaces.processor import IProcessorSet |
465 | + >>> amd64 = getUtility(IProcessorSet).getByName('amd64') |
466 | >>> warty_amd64 = factory.makeDistroArchSeries( |
467 | ... distroseries=warty, architecturetag='amd64', |
468 | - ... processorfamily=amd64) |
469 | + ... processor=amd64) |
470 | >>> submission = factory.makeHWSubmission(distroarchseries=warty_amd64) |
471 | >>> for submission in hw_submission_set.search(distroseries=warty, architecture='amd64'): |
472 | ... print '%s %s ' % ( |
473 | |
474 | === modified file 'lib/lp/registry/browser/distribution.py' |
475 | --- lib/lp/registry/browser/distribution.py 2013-08-01 14:43:03 +0000 |
476 | +++ lib/lp/registry/browser/distribution.py 2013-09-26 04:04:44 +0000 |
477 | @@ -132,11 +132,11 @@ |
478 | from lp.services.webapp.batching import BatchNavigator |
479 | from lp.services.webapp.breadcrumb import Breadcrumb |
480 | from lp.services.webapp.interfaces import ILaunchBag |
481 | -from lp.soyuz.browser.archive import EnableRestrictedFamiliesMixin |
482 | +from lp.soyuz.browser.archive import EnableRestrictedProcessorsMixin |
483 | from lp.soyuz.browser.packagesearch import PackageSearchViewBase |
484 | from lp.soyuz.enums import ArchivePurpose |
485 | from lp.soyuz.interfaces.archive import IArchiveSet |
486 | -from lp.soyuz.interfaces.processor import IProcessorFamilySet |
487 | +from lp.soyuz.interfaces.processor import IProcessorSet |
488 | |
489 | |
490 | class DistributionNavigation( |
491 | @@ -844,9 +844,8 @@ |
492 | archive.require_virtualized = require_virtualized |
493 | |
494 | |
495 | -class DistributionAddView(LaunchpadFormView, |
496 | - RequireVirtualizedBuildersMixin, |
497 | - EnableRestrictedFamiliesMixin): |
498 | +class DistributionAddView(LaunchpadFormView, RequireVirtualizedBuildersMixin, |
499 | + EnableRestrictedProcessorsMixin): |
500 | |
501 | schema = IDistribution |
502 | label = "Register a new distribution" |
503 | @@ -864,7 +863,7 @@ |
504 | "answers_usage", |
505 | ] |
506 | custom_widget('require_virtualized', CheckBoxWidget) |
507 | - custom_widget('enabled_restricted_families', LabeledMultiCheckBoxWidget) |
508 | + custom_widget('enabled_restricted_processors', LabeledMultiCheckBoxWidget) |
509 | |
510 | @property |
511 | def page_title(self): |
512 | @@ -873,10 +872,9 @@ |
513 | |
514 | @property |
515 | def initial_values(self): |
516 | - proc_family_set = getUtility(IProcessorFamilySet) |
517 | - restricted_families = set(proc_family_set.getRestricted()) |
518 | + restricted_processors = getUtility(IProcessorSet).getRestricted() |
519 | return { |
520 | - 'enabled_restricted_families': restricted_families, |
521 | + 'enabled_restricted_processors': restricted_processors, |
522 | 'require_virtualized': False, |
523 | } |
524 | |
525 | @@ -889,9 +887,9 @@ |
526 | """See `LaunchpadFormView`.""" |
527 | LaunchpadFormView.setUpFields(self) |
528 | self.form_fields += self.createRequireVirtualized() |
529 | - self.form_fields += self.createEnabledRestrictedFamilies( |
530 | - u'The restricted architecture families on which the ' |
531 | - "distribution's main archive can build.") |
532 | + self.form_fields += self.createEnabledRestrictedProcessors( |
533 | + u"The restricted architectures on which the distribution's main " |
534 | + "archive can build.") |
535 | |
536 | @action("Save", name='save') |
537 | def save_action(self, action, data): |
538 | @@ -909,8 +907,8 @@ |
539 | archive = distribution.main_archive |
540 | self.updateRequireVirtualized(data['require_virtualized'], archive) |
541 | if archive.require_virtualized is True: |
542 | - archive.enabled_restricted_families = ( |
543 | - data['enabled_restricted_families']) |
544 | + archive.enabled_restricted_processors = data[ |
545 | + 'enabled_restricted_processors'] |
546 | |
547 | notify(ObjectCreatedEvent(distribution)) |
548 | self.next_url = canonical_url(distribution) |
549 | @@ -918,7 +916,7 @@ |
550 | |
551 | class DistributionEditView(RegistryEditFormView, |
552 | RequireVirtualizedBuildersMixin, |
553 | - EnableRestrictedFamiliesMixin): |
554 | + EnableRestrictedProcessorsMixin): |
555 | |
556 | schema = IDistribution |
557 | field_names = [ |
558 | @@ -944,7 +942,7 @@ |
559 | custom_widget('logo', ImageChangeWidget, ImageChangeWidget.EDIT_STYLE) |
560 | custom_widget('mugshot', ImageChangeWidget, ImageChangeWidget.EDIT_STYLE) |
561 | custom_widget('require_virtualized', CheckBoxWidget) |
562 | - custom_widget('enabled_restricted_families', LabeledMultiCheckBoxWidget) |
563 | + custom_widget('enabled_restricted_processors', LabeledMultiCheckBoxWidget) |
564 | |
565 | @property |
566 | def label(self): |
567 | @@ -955,17 +953,17 @@ |
568 | """See `LaunchpadFormView`.""" |
569 | RegistryEditFormView.setUpFields(self) |
570 | self.form_fields += self.createRequireVirtualized() |
571 | - self.form_fields += self.createEnabledRestrictedFamilies( |
572 | - u'The restricted architecture families on which the ' |
573 | - "distribution's main archive can build.") |
574 | + self.form_fields += self.createEnabledRestrictedProcessors( |
575 | + u"The restricted architectures on which the distribution's main " |
576 | + "archive can build.") |
577 | |
578 | @property |
579 | def initial_values(self): |
580 | return { |
581 | 'require_virtualized': |
582 | self.context.main_archive.require_virtualized, |
583 | - 'enabled_restricted_families': |
584 | - self.context.main_archive.enabled_restricted_families, |
585 | + 'enabled_restricted_processors': |
586 | + self.context.main_archive.enabled_restricted_processors, |
587 | } |
588 | |
589 | def validate(self, data): |
590 | @@ -984,14 +982,14 @@ |
591 | self.updateRequireVirtualized( |
592 | new_require_virtualized, self.context.main_archive) |
593 | del(data['require_virtualized']) |
594 | - new_enabled_restricted_families = data.get( |
595 | - 'enabled_restricted_families') |
596 | - if new_enabled_restricted_families is not None: |
597 | - if (set(self.context.main_archive.enabled_restricted_families) != |
598 | - set(new_enabled_restricted_families)): |
599 | - self.context.main_archive.enabled_restricted_families = ( |
600 | - new_enabled_restricted_families) |
601 | - del(data['enabled_restricted_families']) |
602 | + new_enabled_restricted_processors = data.get( |
603 | + 'enabled_restricted_processors') |
604 | + if new_enabled_restricted_processors is not None: |
605 | + if (set(self.context.main_archive.enabled_restricted_processors) != |
606 | + set(new_enabled_restricted_processors)): |
607 | + self.context.main_archive.enabled_restricted_processors = ( |
608 | + new_enabled_restricted_processors) |
609 | + del(data['enabled_restricted_processors']) |
610 | |
611 | @action("Change", name='change') |
612 | def change_action(self, action, data): |
613 | |
614 | === modified file 'lib/lp/registry/browser/tests/distribution-views.txt' |
615 | --- lib/lp/registry/browser/tests/distribution-views.txt 2012-06-11 00:03:25 +0000 |
616 | +++ lib/lp/registry/browser/tests/distribution-views.txt 2013-09-26 04:04:44 +0000 |
617 | @@ -80,7 +80,7 @@ |
618 | ... 'field.domainname': 'youbuntu.me', |
619 | ... 'field.members': 'landscape-developers', |
620 | ... 'field.require_virtualized': 'on', |
621 | - ... 'field.enabled_restricted_families': [], |
622 | + ... 'field.enabled_restricted_processors': [], |
623 | ... 'field.actions.save': 'Save', |
624 | ... } |
625 | >>> view = create_initialized_view(distributionset, '+add', form=form) |
626 | |
627 | === modified file 'lib/lp/registry/browser/tests/test_distribution_views.py' |
628 | --- lib/lp/registry/browser/tests/test_distribution_views.py 2013-09-12 02:29:55 +0000 |
629 | +++ lib/lp/registry/browser/tests/test_distribution_views.py 2013-09-26 04:04:44 +0000 |
630 | @@ -10,7 +10,7 @@ |
631 | from lp.registry.browser.distribution import DistributionPublisherConfigView |
632 | from lp.registry.interfaces.distribution import IDistributionSet |
633 | from lp.services.webapp.servers import LaunchpadTestRequest |
634 | -from lp.soyuz.interfaces.processor import IProcessorFamilySet |
635 | +from lp.soyuz.interfaces.processor import IProcessorSet |
636 | from lp.testing import ( |
637 | login, |
638 | login_celebrity, |
639 | @@ -105,8 +105,7 @@ |
640 | self.simple_user = self.factory.makePerson() |
641 | self.admin = login_celebrity('admin') |
642 | self.distributionset = getUtility(IDistributionSet) |
643 | - proc_family_set = getUtility(IProcessorFamilySet) |
644 | - self.restricted_families = proc_family_set.getRestricted() |
645 | + self.restricted_processors = getUtility(IProcessorSet).getRestricted() |
646 | |
647 | def getDefaultAddDict(self): |
648 | return { |
649 | @@ -118,8 +117,8 @@ |
650 | 'field.domainname': 'newbuntu', |
651 | 'field.members': self.simple_user.name, |
652 | 'field.require_virtualized': '', |
653 | - 'field.enabled_restricted_families': [family.name |
654 | - for family in self.restricted_families], |
655 | + 'field.enabled_restricted_processors': [processor.name |
656 | + for processor in self.restricted_processors], |
657 | 'field.actions.save': 'Save', |
658 | } |
659 | |
660 | @@ -142,16 +141,16 @@ |
661 | widget = view.widgets['require_virtualized'] |
662 | self.assertEqual(False, widget._getCurrentValue()) |
663 | |
664 | - def test_add_distro_init_value_enabled_restricted_families(self): |
665 | + def test_add_distro_init_value_enabled_restricted_processors(self): |
666 | view = create_initialized_view( |
667 | self.distributionset, '+add', principal=self.admin, |
668 | method='GET') |
669 | |
670 | - widget = view.widgets['enabled_restricted_families'] |
671 | - self.assertContentEqual( |
672 | - self.restricted_families, widget._getCurrentValue()) |
673 | - self.assertContentEqual( |
674 | - self.restricted_families, |
675 | + widget = view.widgets['enabled_restricted_processors'] |
676 | + self.assertContentEqual( |
677 | + self.restricted_processors, widget._getCurrentValue()) |
678 | + self.assertContentEqual( |
679 | + self.restricted_processors, |
680 | [item.value for item in widget.vocabulary]) |
681 | |
682 | def test_add_distro_require_virtualized(self): |
683 | @@ -166,16 +165,16 @@ |
684 | False, |
685 | distribution.main_archive.require_virtualized) |
686 | |
687 | - def test_add_distro_enabled_restricted_families(self): |
688 | + def test_add_distro_enabled_restricted_processors(self): |
689 | creation_form = self.getDefaultAddDict() |
690 | - creation_form['field.enabled_restricted_families'] = [] |
691 | + creation_form['field.enabled_restricted_processors'] = [] |
692 | create_initialized_view( |
693 | self.distributionset, '+add', principal=self.admin, |
694 | method='POST', form=creation_form) |
695 | |
696 | distribution = self.distributionset.getByName('newbuntu') |
697 | self.assertContentEqual( |
698 | - [], distribution.main_archive.enabled_restricted_families) |
699 | + [], distribution.main_archive.enabled_restricted_processors) |
700 | |
701 | |
702 | class TestDistroEditView(TestCaseWithFactory): |
703 | @@ -187,11 +186,7 @@ |
704 | super(TestDistroEditView, self).setUp() |
705 | self.admin = login_celebrity('admin') |
706 | self.distribution = self.factory.makeDistribution() |
707 | - proc_family_set = getUtility(IProcessorFamilySet) |
708 | - self.restricted_families = proc_family_set.getRestricted() |
709 | - for family in self.restricted_families: |
710 | - if family.processors.is_empty(): |
711 | - self.factory.makeProcessor(family=family) |
712 | + self.restricted_processors = getUtility(IProcessorSet).getRestricted() |
713 | |
714 | def test_edit_distro_init_value_require_virtualized(self): |
715 | view = create_initialized_view( |
716 | @@ -203,18 +198,18 @@ |
717 | self.distribution.main_archive.require_virtualized, |
718 | widget._getCurrentValue()) |
719 | |
720 | - def test_edit_distro_init_value_enabled_restricted_families(self): |
721 | - self.distribution.main_archive.enabled_restricted_families = ( |
722 | - self.restricted_families) |
723 | + def test_edit_distro_init_value_enabled_restricted_processors(self): |
724 | + self.distribution.main_archive.enabled_restricted_processors = ( |
725 | + self.restricted_processors) |
726 | view = create_initialized_view( |
727 | self.distribution, '+edit', principal=self.admin, |
728 | method='GET') |
729 | |
730 | - widget = view.widgets['enabled_restricted_families'] |
731 | - self.assertContentEqual( |
732 | - self.restricted_families, widget._getCurrentValue()) |
733 | - self.assertContentEqual( |
734 | - self.restricted_families, |
735 | + widget = view.widgets['enabled_restricted_processors'] |
736 | + self.assertContentEqual( |
737 | + self.restricted_processors, widget._getCurrentValue()) |
738 | + self.assertContentEqual( |
739 | + self.restricted_processors, |
740 | [item.value for item in widget.vocabulary]) |
741 | |
742 | def getDefaultEditDict(self): |
743 | @@ -224,8 +219,8 @@ |
744 | 'field.summary': 'newbuntu', |
745 | 'field.description': 'newbuntu', |
746 | 'field.require_virtualized.used': u'', |
747 | - 'field.enabled_restricted_families': [family.name |
748 | - for family in self.restricted_families], |
749 | + 'field.enabled_restricted_processors': [processor.name |
750 | + for processor in self.restricted_processors], |
751 | 'field.actions.change': 'Change', |
752 | } |
753 | |
754 | @@ -241,18 +236,18 @@ |
755 | True, |
756 | self.distribution.main_archive.require_virtualized) |
757 | |
758 | - def test_change_enabled_restricted_families(self): |
759 | + def test_change_enabled_restricted_processors(self): |
760 | edit_form = self.getDefaultEditDict() |
761 | - edit_form['field.enabled_restricted_families'] = [] |
762 | + edit_form['field.enabled_restricted_processors'] = [] |
763 | |
764 | - self.distribution.main_archive.enabled_restricted_families = ( |
765 | - self.restricted_families) |
766 | + self.distribution.main_archive.enabled_restricted_processors = ( |
767 | + self.restricted_processors) |
768 | create_initialized_view( |
769 | self.distribution, '+edit', principal=self.admin, |
770 | method='POST', form=edit_form) |
771 | |
772 | self.assertContentEqual( |
773 | - [], self.distribution.main_archive.enabled_restricted_families) |
774 | + [], self.distribution.main_archive.enabled_restricted_processors) |
775 | |
776 | def test_package_derivatives_email(self): |
777 | # Test that the edit form allows changing package_derivatives_email |
778 | |
779 | === modified file 'lib/lp/registry/doc/distroseries.txt' |
780 | --- lib/lp/registry/doc/distroseries.txt 2013-08-01 14:09:45 +0000 |
781 | +++ lib/lp/registry/doc/distroseries.txt 2013-09-26 04:04:44 +0000 |
782 | @@ -385,9 +385,9 @@ |
783 | |
784 | >>> for bin in bumpy_firefox_sp.currentrelease.binaries: |
785 | ... print bin.id, bin.title, bin.build.distro_arch_series.title |
786 | - 27 mozilla-firefox-data-0.9 The Warty Warthog Release for i386 (x86) |
787 | + 27 mozilla-firefox-data-0.9 The Warty Warthog Release for i386 (386) |
788 | 26 mozilla-firefox-0.9 The Warty Warthog Release for hppa (hppa) |
789 | - 12 mozilla-firefox-0.9 The Warty Warthog Release for i386 (x86) |
790 | + 12 mozilla-firefox-0.9 The Warty Warthog Release for i386 (386) |
791 | |
792 | |
793 | 'builds' should be empty since it was built in parent (warty), not in this |
794 | |
795 | === modified file 'lib/lp/registry/interfaces/distroseries.py' |
796 | --- lib/lp/registry/interfaces/distroseries.py 2013-08-01 14:09:45 +0000 |
797 | +++ lib/lp/registry/interfaces/distroseries.py 2013-09-26 04:04:44 +0000 |
798 | @@ -767,7 +767,7 @@ |
799 | :return: A new `PackageUpload`. |
800 | """ |
801 | |
802 | - def newArch(architecturetag, processorfamily, official, owner, |
803 | + def newArch(architecturetag, processor, official, owner, |
804 | supports_virtualized=False, enabled=True): |
805 | """Create a new port or DistroArchSeries for this DistroSeries.""" |
806 | |
807 | |
808 | === modified file 'lib/lp/registry/model/distroseries.py' |
809 | --- lib/lp/registry/model/distroseries.py 2013-09-25 03:14:42 +0000 |
810 | +++ lib/lp/registry/model/distroseries.py 2013-09-26 04:04:44 +0000 |
811 | @@ -1103,15 +1103,13 @@ |
812 | # results will only see DSBPs |
813 | return DecoratedResultSet(package_caches, result_to_dsbp) |
814 | |
815 | - def newArch(self, architecturetag, processorfamily, official, owner, |
816 | + def newArch(self, architecturetag, processor, official, owner, |
817 | supports_virtualized=False, enabled=True): |
818 | """See `IDistroSeries`.""" |
819 | - distroarchseries = DistroArchSeries( |
820 | - architecturetag=architecturetag, processorfamily=processorfamily, |
821 | - processor=processorfamily.processors[0], official=official, |
822 | - distroseries=self, owner=owner, |
823 | + return DistroArchSeries( |
824 | + architecturetag=architecturetag, processor=processor, |
825 | + official=official, distroseries=self, owner=owner, |
826 | supports_virtualized=supports_virtualized, enabled=enabled) |
827 | - return distroarchseries |
828 | |
829 | def newMilestone(self, name, dateexpected=None, summary=None, |
830 | code_name=None, tags=None): |
831 | |
832 | === modified file 'lib/lp/registry/stories/distribution/xx-distribution-launchpad-usage.txt' |
833 | --- lib/lp/registry/stories/distribution/xx-distribution-launchpad-usage.txt 2012-09-21 15:09:45 +0000 |
834 | +++ lib/lp/registry/stories/distribution/xx-distribution-launchpad-usage.txt 2013-09-26 04:04:44 +0000 |
835 | @@ -21,6 +21,12 @@ |
836 | ... |
837 | Unauthorized... |
838 | |
839 | +Create a restricted processor. |
840 | + |
841 | + >>> login('admin@canonical.com') |
842 | + >>> ign = factory.makeProcessor(name='arm', restricted=True) |
843 | + >>> logout() |
844 | + |
845 | The distribution's registrant can access the page and change the usage. |
846 | |
847 | >>> registrant = setupBrowser( |
848 | @@ -42,7 +48,7 @@ |
849 | >>> print registrant.getControl(name='field.require_virtualized').value |
850 | False |
851 | >>> print registrant.getControl( |
852 | - ... name='field.enabled_restricted_families').value |
853 | + ... name='field.enabled_restricted_processors').value |
854 | [] |
855 | |
856 | >>> registrant.getControl(name='field.translations_usage').value = [ |
857 | |
858 | === modified file 'lib/lp/registry/tests/test_distroseries.py' |
859 | --- lib/lp/registry/tests/test_distroseries.py 2013-08-23 05:36:46 +0000 |
860 | +++ lib/lp/registry/tests/test_distroseries.py 2013-09-26 04:04:44 +0000 |
861 | @@ -34,7 +34,6 @@ |
862 | IDistroSeriesSourcePackageRelease, |
863 | ) |
864 | from lp.soyuz.interfaces.publishing import active_publishing_status |
865 | -from lp.soyuz.model.processor import ProcessorFamilySet |
866 | from lp.soyuz.tests.test_publishing import SoyuzTestPublisher |
867 | from lp.testing import ( |
868 | ANONYMOUS, |
869 | @@ -206,24 +205,23 @@ |
870 | self.assertEqual(suite, distroseries.getSuite(pocket)) |
871 | |
872 | def test_getDistroArchSeriesByProcessor(self): |
873 | - # A IDistroArchSeries can be retrieved by processor |
874 | + # A IDistroArchSeries can be retrieved by processor. |
875 | distroseries = self.factory.makeDistroSeries() |
876 | - processorfamily = ProcessorFamilySet().getByName('x86') |
877 | + processor = self.factory.makeProcessor() |
878 | distroarchseries = self.factory.makeDistroArchSeries( |
879 | distroseries=distroseries, architecturetag='i386', |
880 | - processorfamily=processorfamily) |
881 | - self.assertEquals(distroarchseries, |
882 | - distroseries.getDistroArchSeriesByProcessor( |
883 | - processorfamily.processors[0])) |
884 | + processor=processor) |
885 | + self.assertEquals( |
886 | + distroarchseries, |
887 | + distroseries.getDistroArchSeriesByProcessor(processor)) |
888 | |
889 | def test_getDistroArchSeriesByProcessor_none(self): |
890 | # getDistroArchSeriesByProcessor returns None when no distroarchseries |
891 | # is found |
892 | distroseries = self.factory.makeDistroSeries() |
893 | - processorfamily = ProcessorFamilySet().getByName('x86') |
894 | - self.assertIs(None, |
895 | - distroseries.getDistroArchSeriesByProcessor( |
896 | - processorfamily.processors[0])) |
897 | + processor = self.factory.makeProcessor() |
898 | + self.assertIs( |
899 | + None, distroseries.getDistroArchSeriesByProcessor(processor)) |
900 | |
901 | def test_getDerivedSeries(self): |
902 | dsp = self.factory.makeDistroSeriesParent() |
903 | |
904 | === modified file 'lib/lp/services/webservice/wadl-to-refhtml.xsl' |
905 | --- lib/lp/services/webservice/wadl-to-refhtml.xsl 2011-11-16 22:40:16 +0000 |
906 | +++ lib/lp/services/webservice/wadl-to-refhtml.xsl 2013-09-26 04:04:44 +0000 |
907 | @@ -399,10 +399,6 @@ |
908 | <xsl:text>/+processors/</xsl:text> |
909 | <var><processor.name></var> |
910 | </xsl:when> |
911 | - <xsl:when test="@id = 'processor_family'"> |
912 | - <xsl:text>/+processor-families/</xsl:text> |
913 | - <var><processor_family.name></var> |
914 | - </xsl:when> |
915 | <xsl:when test="@id = 'product_release'"> |
916 | <xsl:text>/</xsl:text> |
917 | <var><product.name></var> |
918 | |
919 | === modified file 'lib/lp/soyuz/adapters/tests/test_buildarch.py' |
920 | --- lib/lp/soyuz/adapters/tests/test_buildarch.py 2013-05-31 04:27:26 +0000 |
921 | +++ lib/lp/soyuz/adapters/tests/test_buildarch.py 2013-09-26 04:04:44 +0000 |
922 | @@ -1,8 +1,9 @@ |
923 | # Copyright 2009-2013 Canonical Ltd. This software is licensed under the |
924 | # GNU Affero General Public License version 3 (see the file LICENSE). |
925 | |
926 | +__metaclass__ = type |
927 | + |
928 | from lp.soyuz.adapters.buildarch import determine_architectures_to_build |
929 | -from lp.soyuz.model.processor import ProcessorFamily |
930 | from lp.soyuz.tests.test_publishing import SoyuzTestPublisher |
931 | from lp.testing import TestCaseWithFactory |
932 | from lp.testing.layers import LaunchpadZopelessLayer |
933 | @@ -18,11 +19,9 @@ |
934 | super(TestDetermineArchitecturesToBuild, self).setUp() |
935 | self.publisher = SoyuzTestPublisher() |
936 | self.publisher.prepareBreezyAutotest() |
937 | - armel_family = ProcessorFamily.get(5) |
938 | - if not armel_family.processors: |
939 | - armel_family.addProcessor('armel', 'armel', 'armel') |
940 | + armel = self.factory.makeProcessor('armel', 'armel', 'armel') |
941 | self.publisher.breezy_autotest.newArch( |
942 | - 'armel', armel_family, False, self.publisher.person) |
943 | + 'armel', armel, False, self.publisher.person) |
944 | self.publisher.addFakeChroots() |
945 | |
946 | def assertArchitecturesToBuild(self, expected_arch_tags, pub, |
947 | |
948 | === modified file 'lib/lp/soyuz/browser/archive.py' |
949 | --- lib/lp/soyuz/browser/archive.py 2013-05-24 01:28:22 +0000 |
950 | +++ lib/lp/soyuz/browser/archive.py 2013-09-26 04:04:44 +0000 |
951 | @@ -22,7 +22,7 @@ |
952 | 'ArchivePackagesView', |
953 | 'ArchiveView', |
954 | 'ArchiveViewBase', |
955 | - 'EnableRestrictedFamiliesMixin', |
956 | + 'EnableRestrictedProcessorsMixin', |
957 | 'make_archive_vocabulary', |
958 | 'PackageCopyingMixin', |
959 | 'traverse_named_ppa', |
960 | @@ -148,7 +148,7 @@ |
961 | from lp.soyuz.interfaces.packagecopyjob import IPlainPackageCopyJobSource |
962 | from lp.soyuz.interfaces.packagecopyrequest import IPackageCopyRequestSet |
963 | from lp.soyuz.interfaces.packageset import IPackagesetSet |
964 | -from lp.soyuz.interfaces.processor import IProcessorFamilySet |
965 | +from lp.soyuz.interfaces.processor import IProcessorSet |
966 | from lp.soyuz.interfaces.publishing import ( |
967 | active_publishing_status, |
968 | inactive_publishing_status, |
969 | @@ -2005,16 +2005,16 @@ |
970 | return 'Edit %s' % self.context.displayname |
971 | |
972 | |
973 | -class EnableRestrictedFamiliesMixin: |
974 | - """A mixin that provides enabled_restricted_families field support""" |
975 | +class EnableRestrictedProcessorsMixin: |
976 | + """A mixin that provides enabled_restricted_processors field support""" |
977 | |
978 | - def createEnabledRestrictedFamilies(self, description=None): |
979 | - """Creates the 'enabled_restricted_families' field.""" |
980 | + def createEnabledRestrictedProcessors(self, description=None): |
981 | + """Creates the 'enabled_restricted_processors' field.""" |
982 | terms = [] |
983 | - for family in getUtility(IProcessorFamilySet).getRestricted(): |
984 | + for processor in getUtility(IProcessorSet).getRestricted(): |
985 | terms.append(SimpleTerm( |
986 | - family, token=family.name, title=family.title)) |
987 | - old_field = IArchive['enabled_restricted_families'] |
988 | + processor, token=processor.name, title=processor.title)) |
989 | + old_field = IArchive['enabled_restricted_processors'] |
990 | return form.Fields( |
991 | List(__name__=old_field.__name__, |
992 | title=old_field.title, |
993 | @@ -2025,7 +2025,7 @@ |
994 | render_context=self.render_context) |
995 | |
996 | |
997 | -class ArchiveAdminView(BaseArchiveEditView, EnableRestrictedFamiliesMixin): |
998 | +class ArchiveAdminView(BaseArchiveEditView, EnableRestrictedProcessorsMixin): |
999 | |
1000 | field_names = [ |
1001 | 'enabled', |
1002 | @@ -2040,7 +2040,7 @@ |
1003 | 'external_dependencies', |
1004 | ] |
1005 | custom_widget('external_dependencies', TextAreaWidget, height=3) |
1006 | - custom_widget('enabled_restricted_families', LabeledMultiCheckBoxWidget) |
1007 | + custom_widget('enabled_restricted_processors', LabeledMultiCheckBoxWidget) |
1008 | page_title = 'Administer' |
1009 | |
1010 | @property |
1011 | @@ -2084,17 +2084,17 @@ |
1012 | @property |
1013 | def initial_values(self): |
1014 | return { |
1015 | - 'enabled_restricted_families': |
1016 | - self.context.enabled_restricted_families, |
1017 | + 'enabled_restricted_processors': |
1018 | + self.context.enabled_restricted_processors, |
1019 | } |
1020 | |
1021 | def setUpFields(self): |
1022 | """Override `LaunchpadEditFormView`. |
1023 | |
1024 | - See `createEnabledRestrictedFamilies` method. |
1025 | + See `createEnabledRestrictedProcessors` method. |
1026 | """ |
1027 | super(ArchiveAdminView, self).setUpFields() |
1028 | - self.form_fields += self.createEnabledRestrictedFamilies() |
1029 | + self.form_fields += self.createEnabledRestrictedProcessors() |
1030 | |
1031 | |
1032 | class ArchiveDeleteView(LaunchpadFormView): |
1033 | |
1034 | === modified file 'lib/lp/soyuz/browser/configure.zcml' |
1035 | --- lib/lp/soyuz/browser/configure.zcml 2013-05-10 05:30:11 +0000 |
1036 | +++ lib/lp/soyuz/browser/configure.zcml 2013-09-26 04:04:44 +0000 |
1037 | @@ -37,13 +37,6 @@ |
1038 | path_expression="string:+binarypub" |
1039 | attribute_to_parent="archive" |
1040 | urldata="lp.soyuz.browser.publishing.BinaryPublicationURL"/> |
1041 | - <browser:url for="lp.soyuz.interfaces.processor.IProcessorFamilySet" |
1042 | - path_expression="string:+processor-families" |
1043 | - parent_utility="lp.services.webapp.interfaces.ILaunchpadRoot"/> |
1044 | - <browser:url |
1045 | - for="lp.soyuz.interfaces.processor.IProcessorFamily" |
1046 | - path_expression="string:${name}" |
1047 | - parent_utility="lp.soyuz.interfaces.processor.IProcessorFamilySet" /> |
1048 | <browser:url for="lp.soyuz.interfaces.processor.IProcessorSet" |
1049 | path_expression="string:+processors" |
1050 | parent_utility="lp.services.webapp.interfaces.ILaunchpadRoot"/> |
1051 | @@ -232,7 +225,7 @@ |
1052 | classes="ArchiveNavigation" /> |
1053 | <browser:navigation |
1054 | module="lp.soyuz.browser.processor" |
1055 | - classes="ProcessorFamilySetNavigation ProcessorSetNavigation"/> |
1056 | + classes="ProcessorSetNavigation" /> |
1057 | <browser:url |
1058 | for="lp.soyuz.interfaces.archive.IPPA" |
1059 | path_expression="string:+archive" |
1060 | |
1061 | === modified file 'lib/lp/soyuz/browser/distroarchseries.py' |
1062 | --- lib/lp/soyuz/browser/distroarchseries.py 2012-01-05 20:11:40 +0000 |
1063 | +++ lib/lp/soyuz/browser/distroarchseries.py 2013-09-26 04:04:44 +0000 |
1064 | @@ -93,8 +93,8 @@ |
1065 | class DistroArchSeriesAddView(LaunchpadFormView): |
1066 | |
1067 | schema = IDistroArchSeries |
1068 | - field_names = ['architecturetag', 'processorfamily', 'official', |
1069 | - 'supports_virtualized'] |
1070 | + field_names = [ |
1071 | + 'architecturetag', 'processor', 'official', 'supports_virtualized'] |
1072 | |
1073 | @property |
1074 | def label(self): |
1075 | @@ -115,7 +115,7 @@ |
1076 | def create_action(self, action, data): |
1077 | """Create a new Port.""" |
1078 | distroarchseries = self.context.newArch( |
1079 | - data['architecturetag'], data['processorfamily'], |
1080 | + data['architecturetag'], data['processor'], |
1081 | data['official'], self.user, data['supports_virtualized']) |
1082 | self.next_url = canonical_url(distroarchseries) |
1083 | |
1084 | |
1085 | === modified file 'lib/lp/soyuz/browser/processor.py' |
1086 | --- lib/lp/soyuz/browser/processor.py 2012-01-01 02:58:52 +0000 |
1087 | +++ lib/lp/soyuz/browser/processor.py 2013-09-26 04:04:44 +0000 |
1088 | @@ -3,37 +3,19 @@ |
1089 | |
1090 | """Navigation views for processors.""" |
1091 | |
1092 | - |
1093 | __metaclass__ = type |
1094 | |
1095 | __all__ = [ |
1096 | - 'ProcessorFamilySetNavigation', |
1097 | 'ProcessorSetNavigation', |
1098 | ] |
1099 | |
1100 | |
1101 | -from lp.app.errors import NotFoundError |
1102 | from lp.services.webapp import Navigation |
1103 | -from lp.soyuz.interfaces.processor import ( |
1104 | - IProcessorFamilySet, |
1105 | - IProcessorSet, |
1106 | - ) |
1107 | - |
1108 | - |
1109 | -class ProcessorFamilySetNavigation(Navigation): |
1110 | - """IProcessorFamilySet navigation.""" |
1111 | - usedfor = IProcessorFamilySet |
1112 | - |
1113 | - def traverse(self, name): |
1114 | - family = self.context.getByName(name) |
1115 | - # Raise NotFoundError on invalid processor family name. |
1116 | - if family is None: |
1117 | - raise NotFoundError(name) |
1118 | - return family |
1119 | +from lp.soyuz.interfaces.processor import IProcessorSet |
1120 | |
1121 | |
1122 | class ProcessorSetNavigation(Navigation): |
1123 | - """IProcessorFamilySet navigation.""" |
1124 | + """IProcessorSet navigation.""" |
1125 | usedfor = IProcessorSet |
1126 | |
1127 | def traverse(self, name): |
1128 | |
1129 | === modified file 'lib/lp/soyuz/browser/tests/test_archive_webservice.py' |
1130 | --- lib/lp/soyuz/browser/tests/test_archive_webservice.py 2013-09-13 07:07:51 +0000 |
1131 | +++ lib/lp/soyuz/browser/tests/test_archive_webservice.py 2013-09-26 04:04:44 +0000 |
1132 | @@ -25,7 +25,6 @@ |
1133 | ) |
1134 | from lp.soyuz.interfaces.component import IComponentSet |
1135 | from lp.soyuz.interfaces.packagecopyjob import IPlainPackageCopyJobSource |
1136 | -from lp.soyuz.interfaces.processor import IProcessorFamilySet |
1137 | from lp.soyuz.model.archivepermission import ArchivePermission |
1138 | from lp.testing import ( |
1139 | celebrity_logged_in, |
1140 | @@ -224,11 +223,11 @@ |
1141 | self.assertContentEqual([], ws_archive.dependencies) |
1142 | |
1143 | |
1144 | -class TestProcessorFamilies(WebServiceTestCase): |
1145 | - """Test the enabled_restricted_families property and methods.""" |
1146 | +class TestProcessors(WebServiceTestCase): |
1147 | + """Test the enabled_restricted_processors property and methods.""" |
1148 | |
1149 | - def test_erfNotAvailableInBeta(self): |
1150 | - """The enabled_restricted_families property is not in beta.""" |
1151 | + def test_erpNotAvailableInBeta(self): |
1152 | + """The enabled_restricted_processors property is not in beta.""" |
1153 | self.ws_version = 'beta' |
1154 | archive = self.factory.makeArchive() |
1155 | commercial = getUtility(ILaunchpadCelebrities).commercial_admin |
1156 | @@ -237,117 +236,80 @@ |
1157 | ws_archive = self.wsObject(archive, user=commercial_admin) |
1158 | expected_re = ( |
1159 | "(.|\n)*object has no attribute " |
1160 | - "'enabled_restricted_families'(.|\n)*") |
1161 | + "'enabled_restricted_processors'(.|\n)*") |
1162 | with ExpectedException(AttributeError, expected_re): |
1163 | - ws_archive.enabled_restricted_families |
1164 | + ws_archive.enabled_restricted_processors |
1165 | |
1166 | - def test_erfAvailableInDevel(self): |
1167 | - """The enabled_restricted_families property is in devel.""" |
1168 | + def test_erpAvailableInDevel(self): |
1169 | + """The enabled_restricted_processors property is in devel.""" |
1170 | self.ws_version = 'devel' |
1171 | archive = self.factory.makeArchive() |
1172 | commercial = getUtility(ILaunchpadCelebrities).commercial_admin |
1173 | commercial_admin = self.factory.makePerson(member_of=[commercial]) |
1174 | transaction.commit() |
1175 | ws_archive = self.wsObject(archive, user=commercial_admin) |
1176 | - self.assertContentEqual([], ws_archive.enabled_restricted_families) |
1177 | self.assertContentEqual([], ws_archive.enabled_restricted_processors) |
1178 | |
1179 | - def test_getByName(self): |
1180 | - """The getByName method returns a processor family.""" |
1181 | - self.ws_version = 'devel' |
1182 | - transaction.commit() |
1183 | - arm = self.service.processor_families.getByName(name='arm') |
1184 | - self.assertEqual(u'arm', arm.name) |
1185 | - self.assertEqual(u'ARM Processors', arm.title) |
1186 | - self.assertEqual( |
1187 | - u'The ARM and compatible processors', arm.description) |
1188 | - self.assertEqual(True, arm.restricted) |
1189 | - |
1190 | def test_processors(self): |
1191 | """Attributes about processors are available.""" |
1192 | self.ws_version = 'devel' |
1193 | - product_family_set = getUtility(IProcessorFamilySet) |
1194 | - ws_arm = self.service.processor_families.getByName(name='arm') |
1195 | - self.assertContentEqual([], ws_arm.processors) |
1196 | - product_family_set = getUtility(IProcessorFamilySet) |
1197 | - arm = product_family_set.getByName('arm') |
1198 | - arm.addProcessor('new-arm', 'New ARM Title', 'New ARM Description') |
1199 | + self.factory.makeProcessor( |
1200 | + 'new-arm', 'New ARM Title', 'New ARM Description') |
1201 | transaction.commit() |
1202 | - ws_proc = ws_arm.processors[0] |
1203 | + ws_proc = self.service.processors.getByName(name='new-arm') |
1204 | self.assertEqual('new-arm', ws_proc.name) |
1205 | self.assertEqual('New ARM Title', ws_proc.title) |
1206 | self.assertEqual('New ARM Description', ws_proc.description) |
1207 | |
1208 | - def test_enableRestrictedFamily(self): |
1209 | - """A new family can be added to the enabled restricted set.""" |
1210 | - self.ws_version = 'devel' |
1211 | - archive = self.factory.makeArchive() |
1212 | - commercial = getUtility(ILaunchpadCelebrities).commercial_admin |
1213 | - commercial_admin = self.factory.makePerson(member_of=[commercial]) |
1214 | - arm_family = getUtility(IProcessorFamilySet).getByName('arm') |
1215 | - self.factory.makeProcessor(family=arm_family) |
1216 | - transaction.commit() |
1217 | - ws_arm = self.service.processor_families.getByName(name='arm') |
1218 | - ws_archive = self.wsObject(archive, user=commercial_admin) |
1219 | - self.assertContentEqual([], ws_archive.enabled_restricted_families) |
1220 | - ws_archive.enableRestrictedFamily(family=ws_arm) |
1221 | - self.assertContentEqual( |
1222 | - [ws_arm], ws_archive.enabled_restricted_families) |
1223 | - |
1224 | def test_enableRestrictedProcessor(self): |
1225 | + """A new processor can be added to the enabled restricted set.""" |
1226 | self.ws_version = 'devel' |
1227 | archive = self.factory.makeArchive() |
1228 | + self.factory.makeProcessor(name='arm', restricted=True) |
1229 | commercial = getUtility(ILaunchpadCelebrities).commercial_admin |
1230 | commercial_admin = self.factory.makePerson(member_of=[commercial]) |
1231 | - arm = getUtility(IProcessorFamilySet).getByName('arm') |
1232 | - arm.addProcessor('new-arm', 'New ARM Title', 'New ARM Description') |
1233 | transaction.commit() |
1234 | - ws_arm = self.service.processors.getByName(name='new-arm') |
1235 | + ws_arm = self.service.processors.getByName(name='arm') |
1236 | ws_archive = self.wsObject(archive, user=commercial_admin) |
1237 | self.assertContentEqual([], ws_archive.enabled_restricted_processors) |
1238 | ws_archive.enableRestrictedProcessor(processor=ws_arm) |
1239 | self.assertContentEqual( |
1240 | [ws_arm], ws_archive.enabled_restricted_processors) |
1241 | |
1242 | - def test_enableRestrictedFamily_owner(self): |
1243 | - """A new family can be added to the enabled restricted set. |
1244 | + def test_enableRestrictedProcessor_owner(self): |
1245 | + """A new processor can be added to the enabled restricted set. |
1246 | |
1247 | An unauthorized user, even the archive owner, is not allowed. |
1248 | """ |
1249 | self.ws_version = 'devel' |
1250 | archive = self.factory.makeArchive() |
1251 | + self.factory.makeProcessor(name='arm', restricted=True) |
1252 | transaction.commit() |
1253 | - ws_arm = self.service.processor_families.getByName(name='arm') |
1254 | + ws_arm = self.service.processors.getByName(name='arm') |
1255 | ws_archive = self.wsObject(archive, user=archive.owner) |
1256 | - self.assertContentEqual([], ws_archive.enabled_restricted_families) |
1257 | + self.assertContentEqual([], ws_archive.enabled_restricted_processors) |
1258 | expected_re = ( |
1259 | "(.|\n)*'launchpad\.Admin'(.|\n)*") |
1260 | with ExpectedException(LRUnauthorized, expected_re): |
1261 | - ws_archive.enableRestrictedFamily(family=ws_arm) |
1262 | + ws_archive.enableRestrictedProcessor(processor=ws_arm) |
1263 | |
1264 | - def test_enableRestrictedFamily_nonPrivUser(self): |
1265 | - """A new family can be added to the enabled restricted set. |
1266 | + def test_enableRestrictedProcessor_nonPrivUser(self): |
1267 | + """A new processor can be added to the enabled restricted set. |
1268 | |
1269 | An unauthorized user, some regular user, is not allowed. |
1270 | """ |
1271 | self.ws_version = 'devel' |
1272 | archive = self.factory.makeArchive() |
1273 | + self.factory.makeProcessor(name='arm', restricted=True) |
1274 | just_some_guy = self.factory.makePerson() |
1275 | transaction.commit() |
1276 | - ws_arm = self.service.processor_families.getByName(name='arm') |
1277 | + ws_arm = self.service.processors.getByName(name='arm') |
1278 | ws_archive = self.wsObject(archive, user=just_some_guy) |
1279 | - self.assertContentEqual([], ws_archive.enabled_restricted_families) |
1280 | + self.assertContentEqual([], ws_archive.enabled_restricted_processors) |
1281 | expected_re = ( |
1282 | "(.|\n)*'launchpad\.Admin'(.|\n)*") |
1283 | with ExpectedException(LRUnauthorized, expected_re): |
1284 | - ws_archive.enableRestrictedFamily(family=ws_arm) |
1285 | - |
1286 | - def test_defaultCollection(self): |
1287 | - """getRestricted will return all of the restricted families.""" |
1288 | - self.ws_version = 'devel' |
1289 | - ws_arm = self.service.processor_families.getByName(name='arm') |
1290 | - self.assertContentEqual( |
1291 | - [ws_arm], self.service.processor_families) |
1292 | + ws_archive.enableRestrictedProcessor(processor=ws_arm) |
1293 | |
1294 | |
1295 | class TestCopyPackage(WebServiceTestCase): |
1296 | |
1297 | === modified file 'lib/lp/soyuz/browser/tests/test_processor.py' |
1298 | --- lib/lp/soyuz/browser/tests/test_processor.py 2012-01-01 02:58:52 +0000 |
1299 | +++ lib/lp/soyuz/browser/tests/test_processor.py 2013-09-26 04:04:44 +0000 |
1300 | @@ -14,28 +14,14 @@ |
1301 | class TestProcessorNavigation(TestCaseWithFactory): |
1302 | layer = DatabaseFunctionalLayer |
1303 | |
1304 | - def test_processor_family_url(self): |
1305 | - family = self.factory.makeProcessorFamily('quantum') |
1306 | - self.assertEquals( |
1307 | - '/+processor-families/quantum', |
1308 | - canonical_url(family, force_local_path=True)) |
1309 | - |
1310 | def test_processor_url(self): |
1311 | - family = self.factory.makeProcessorFamily('quantum') |
1312 | - quantum = family.processors[0] |
1313 | + quantum = self.factory.makeProcessor('quantum') |
1314 | self.assertEquals( |
1315 | '/+processors/quantum', |
1316 | canonical_url(quantum, force_local_path=True)) |
1317 | |
1318 | - def test_processor_family_navigation(self): |
1319 | - family = self.factory.makeProcessorFamily('quantum') |
1320 | - obj, view, request = test_traverse( |
1321 | - 'http://api.launchpad.dev/devel/+processor-families/quantum') |
1322 | - self.assertEquals(family, obj) |
1323 | - |
1324 | def test_processor_navigation(self): |
1325 | - family = self.factory.makeProcessorFamily('quantum') |
1326 | + quantum = self.factory.makeProcessor('quantum') |
1327 | obj, view, request = test_traverse( |
1328 | - 'http://api.launchpad.dev/' |
1329 | - 'devel/+processors/quantum') |
1330 | - self.assertEquals(family.processors[0], obj) |
1331 | + 'http://api.launchpad.dev/devel/+processors/quantum') |
1332 | + self.assertEquals(quantum, obj) |
1333 | |
1334 | === modified file 'lib/lp/soyuz/browser/tests/test_publishing.py' |
1335 | --- lib/lp/soyuz/browser/tests/test_publishing.py 2012-01-01 02:58:52 +0000 |
1336 | +++ lib/lp/soyuz/browser/tests/test_publishing.py 2013-09-26 04:04:44 +0000 |
1337 | @@ -45,11 +45,10 @@ |
1338 | self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL) |
1339 | # Create everything we need to create builds, such as a |
1340 | # DistroArchSeries and a builder. |
1341 | - self.pf = self.factory.makeProcessorFamily() |
1342 | - pf_proc = self.pf.addProcessor(self.factory.getUniqueString(), '', '') |
1343 | + self.processor = self.factory.makeProcessor() |
1344 | self.distroseries = self.factory.makeDistroSeries() |
1345 | self.das = self.factory.makeDistroArchSeries( |
1346 | - distroseries=self.distroseries, processorfamily=self.pf, |
1347 | + distroseries=self.distroseries, processor=self.processor, |
1348 | supports_virtualized=True) |
1349 | self.archive = self.factory.makeArchive( |
1350 | distribution=self.distroseries.distribution) |
1351 | @@ -58,7 +57,7 @@ |
1352 | self.publisher.prepareBreezyAutotest() |
1353 | self.distroseries.nominatedarchindep = self.das |
1354 | self.publisher.addFakeChroots(distroseries=self.distroseries) |
1355 | - self.builder = self.factory.makeBuilder(processor=pf_proc) |
1356 | + self.builder = self.factory.makeBuilder(processor=self.processor) |
1357 | |
1358 | def test_view_with_source_package_recipe(self): |
1359 | # When a SourcePackageRelease is linked to a |
1360 | |
1361 | === modified file 'lib/lp/soyuz/configure.zcml' |
1362 | --- lib/lp/soyuz/configure.zcml 2013-07-26 11:18:27 +0000 |
1363 | +++ lib/lp/soyuz/configure.zcml 2013-09-26 04:04:44 +0000 |
1364 | @@ -369,20 +369,6 @@ |
1365 | permission="zope.Public" |
1366 | set_schema="lp.soyuz.interfaces.processor.IProcessor"/> |
1367 | </class> |
1368 | - <class |
1369 | - class="lp.soyuz.model.processor.ProcessorFamily"> |
1370 | - <allow |
1371 | - interface="lp.soyuz.interfaces.processor.IProcessorFamily"/> |
1372 | - <require |
1373 | - permission="zope.Public" |
1374 | - set_schema="lp.soyuz.interfaces.processor.IProcessorFamily"/> |
1375 | - </class> |
1376 | - <securedutility |
1377 | - class="lp.soyuz.model.processor.ProcessorFamilySet" |
1378 | - provides="lp.soyuz.interfaces.processor.IProcessorFamilySet"> |
1379 | - <allow |
1380 | - interface="lp.soyuz.interfaces.processor.IProcessorFamilySet"/> |
1381 | - </securedutility> |
1382 | <securedutility |
1383 | class="lp.soyuz.model.processor.ProcessorSet" |
1384 | provides="lp.soyuz.interfaces.processor.IProcessorSet"> |
1385 | @@ -428,7 +414,7 @@ |
1386 | permission="launchpad.Admin" |
1387 | interface="lp.soyuz.interfaces.archive.IArchiveAdmin" |
1388 | set_attributes="authorized_size build_debug_symbols |
1389 | - buildd_secret enabled_restricted_families |
1390 | + buildd_secret enabled_restricted_processors |
1391 | external_dependencies name |
1392 | permit_obsolete_series_uploads |
1393 | private publish_debug_symbols |
1394 | |
1395 | === modified file 'lib/lp/soyuz/doc/distroarchseries.txt' |
1396 | --- lib/lp/soyuz/doc/distroarchseries.txt 2013-02-06 09:22:35 +0000 |
1397 | +++ lib/lp/soyuz/doc/distroarchseries.txt 2013-09-26 04:04:44 +0000 |
1398 | @@ -299,7 +299,7 @@ |
1399 | |
1400 | >>> print_architectures(warty.architectures) |
1401 | The Warty Warthog Release for hppa (hppa) |
1402 | - The Warty Warthog Release for i386 (x86) (official, ppa) |
1403 | + The Warty Warthog Release for i386 (386) (official, ppa) |
1404 | |
1405 | DistroArchSeries for which we support PPA building can be obtained via |
1406 | another distroseries method called 'virtualized_architectures'. |
1407 | @@ -312,16 +312,16 @@ |
1408 | >>> expected_ppa_archs = [arch for arch in warty.architectures |
1409 | ... if arch.supports_virtualized is True] |
1410 | >>> print_architectures(expected_ppa_archs) |
1411 | - The Warty Warthog Release for i386 (x86) (official, ppa) |
1412 | + The Warty Warthog Release for i386 (386) (official, ppa) |
1413 | |
1414 | >>> print_architectures(warty.virtualized_architectures) |
1415 | - The Warty Warthog Release for i386 (x86) (official, ppa) |
1416 | + The Warty Warthog Release for i386 (386) (official, ppa) |
1417 | |
1418 | Let's activate ppa support for hoary/hppa and check if |
1419 | 'virtualized_architectures' will include it this time. |
1420 | |
1421 | >>> print_architectures(hoary.virtualized_architectures) |
1422 | - The Hoary Hedgehog Release for i386 (x86) (official, ppa) |
1423 | + The Hoary Hedgehog Release for i386 (386) (official, ppa) |
1424 | |
1425 | >>> from lp.services.database.sqlbase import flush_database_updates |
1426 | >>> login('foo.bar@canonical.com') |
1427 | @@ -331,7 +331,7 @@ |
1428 | |
1429 | >>> print_architectures(hoary.virtualized_architectures) |
1430 | The Hoary Hedgehog Release for hppa (hppa) (ppa) |
1431 | - The Hoary Hedgehog Release for i386 (x86) (official, ppa) |
1432 | + The Hoary Hedgehog Release for i386 (386) (official, ppa) |
1433 | |
1434 | There is also `DistroSeries.buildable_architectures` which returns a |
1435 | `ResultSet` containing only the `DistroArchSeries` with available |
1436 | @@ -373,4 +373,4 @@ |
1437 | |
1438 | >>> print_architectures(hoary.buildable_architectures) |
1439 | The Hoary Hedgehog Release for hppa (hppa) (ppa) |
1440 | - The Hoary Hedgehog Release for i386 (x86) (official, ppa) |
1441 | + The Hoary Hedgehog Release for i386 (386) (official, ppa) |
1442 | |
1443 | === modified file 'lib/lp/soyuz/doc/distroseriesqueue-translations.txt' |
1444 | --- lib/lp/soyuz/doc/distroseriesqueue-translations.txt 2013-07-23 18:49:13 +0000 |
1445 | +++ lib/lp/soyuz/doc/distroseriesqueue-translations.txt 2013-09-26 04:04:44 +0000 |
1446 | @@ -6,7 +6,7 @@ |
1447 | |
1448 | >>> from lp.registry.model.gpgkey import GPGKey |
1449 | >>> from lp.soyuz.model.component import Component |
1450 | - >>> from lp.soyuz.model.processor import ProcessorFamily |
1451 | + >>> from lp.soyuz.interfaces.processor import IProcessorSet |
1452 | >>> from lp.soyuz.model.section import Section |
1453 | >>> from lp.soyuz.model.publishing import ( |
1454 | ... SourcePackagePublishingHistory) |
1455 | @@ -47,7 +47,8 @@ |
1456 | ... 'Dapper', 'Dapper', '06.04', hoary, hoary.owner) |
1457 | |
1458 | # And an AMD 64 arch series. |
1459 | - >>> dapper_amd64 = dapper.newArch('amd64', ProcessorFamily.get(3), True, |
1460 | + >>> dapper_amd64 = dapper.newArch( |
1461 | + ... 'amd64', getUtility(IProcessorSet).getByName('amd64'), True, |
1462 | ... dapper.owner) |
1463 | |
1464 | Only uploads to the RELEASE, UPDATES, SECURITY and PROPOSED pockets are |
1465 | |
1466 | === modified file 'lib/lp/soyuz/doc/gina-multiple-arch.txt' |
1467 | --- lib/lp/soyuz/doc/gina-multiple-arch.txt 2013-09-20 05:25:18 +0000 |
1468 | +++ lib/lp/soyuz/doc/gina-multiple-arch.txt 2013-09-26 04:04:44 +0000 |
1469 | @@ -28,7 +28,7 @@ |
1470 | Create a distribution series and an arch series for dapper: |
1471 | |
1472 | >>> from lp.soyuz.model.distroarchseries import DistroArchSeries |
1473 | - >>> from lp.soyuz.model.processor import ProcessorFamily |
1474 | + >>> from lp.soyuz.interfaces.processor import IProcessorSet |
1475 | >>> from lp.app.interfaces.launchpad import ILaunchpadCelebrities |
1476 | >>> celebs = getUtility(ILaunchpadCelebrities) |
1477 | >>> ubuntu = celebs.ubuntu |
1478 | @@ -44,31 +44,20 @@ |
1479 | Check it was properly created and create its DistroArchSeriess. |
1480 | |
1481 | >>> from lp.registry.model.distroseries import DistroSeries |
1482 | - >>> dapper = DistroSeries.selectOneBy(name="dapper", |
1483 | - ... distributionID=ubuntu.id) |
1484 | - >>> pf = ProcessorFamily.selectOneBy(name="x86") |
1485 | - >>> if pf is None: |
1486 | - ... pf = ProcessorFamily(name="x86", title="X86", |
1487 | - ... description="Intel X86") |
1488 | - >>> dar = dapper.newArch( |
1489 | - ... processorfamily=pf, architecturetag="i386", official=True, |
1490 | - ... owner=celebs.launchpad_developers) |
1491 | - >>> pf = ProcessorFamily.selectOneBy(name="amd64") |
1492 | - >>> if pf is None: |
1493 | - ... pf = ProcessorFamily(name="amd64", title="AMD64", |
1494 | - ... description="AMD 64") |
1495 | - >>> dar = dapper.newArch( |
1496 | - ... processorfamily=pf, architecturetag="amd64", official=True, |
1497 | - ... owner=celebs.launchpad_developers) |
1498 | - >>> pf = ProcessorFamily.selectOneBy(name="powerpc") |
1499 | - >>> if pf is None: |
1500 | - ... pf = ProcessorFamily(name="powerpc", title="PowerPC", |
1501 | - ... description="PowerPC") |
1502 | - >>> from lp.soyuz.model.processor import Processor |
1503 | - >>> p = Processor(name="powerpc", title="PowerPC", family=pf, |
1504 | - ... description="The little processor that could") |
1505 | - >>> dar = dapper.newArch( |
1506 | - ... processorfamily=pf, architecturetag="powerpc", official=True, |
1507 | + >>> dapper = DistroSeries.selectOneBy( |
1508 | + ... name="dapper", distributionID=ubuntu.id) |
1509 | + >>> processor = getUtility(IProcessorSet).getByName('386') |
1510 | + >>> dar = dapper.newArch( |
1511 | + ... processor=processor, architecturetag="i386", official=True, |
1512 | + ... owner=celebs.launchpad_developers) |
1513 | + >>> processor = getUtility(IProcessorSet).getByName('amd64') |
1514 | + >>> dar = dapper.newArch( |
1515 | + ... processor=processor, architecturetag="amd64", official=True, |
1516 | + ... owner=celebs.launchpad_developers) |
1517 | + >>> processor = getUtility(IProcessorSet).new( |
1518 | + ... 'powerpc', 'PowerPC', 'PowerPC') |
1519 | + >>> dar = dapper.newArch( |
1520 | + ... processor=processor, architecturetag="powerpc", official=True, |
1521 | ... owner=celebs.launchpad_developers) |
1522 | >>> import transaction |
1523 | >>> transaction.commit() |
1524 | @@ -88,14 +77,6 @@ |
1525 | >>> path = os.path.join(os.getcwd(), relative_path) |
1526 | >>> os.symlink(path, '/tmp/gina_test_archive') |
1527 | |
1528 | -Set up the processor, commit and run her again. Note that |
1529 | -dapper-updates/universe doesn't include the powerpc architecture, but we |
1530 | -just warn it and move right ahead. |
1531 | - |
1532 | - >>> p == Processor.selectOneBy(familyID=pf.id) |
1533 | - True |
1534 | - >>> transaction.commit() |
1535 | - |
1536 | >>> gina_proc = [sys.executable, 'scripts/gina.py', '-q', |
1537 | ... 'dapper', 'dapper-updates'] |
1538 | >>> proc = subprocess.Popen(gina_proc, stderr=subprocess.PIPE) |
1539 | @@ -210,9 +191,9 @@ |
1540 | |
1541 | Check that we publishing bdftopcf into the correct distroarchseries: |
1542 | |
1543 | - >>> pf = ProcessorFamily.selectOneBy(name="x86") |
1544 | + >>> processor = getUtility(IProcessorSet).getByName('386') |
1545 | >>> dar = DistroArchSeries.selectOneBy(distroseriesID=dapper.id, |
1546 | - ... processorfamilyID=pf.id, architecturetag="i386", |
1547 | + ... processor_id=processor.id, architecturetag="i386", |
1548 | ... official=True, ownerID=celebs.launchpad_developers.id) |
1549 | >>> print dar.architecturetag |
1550 | i386 |
1551 | |
1552 | === modified file 'lib/lp/soyuz/doc/gina.txt' |
1553 | --- lib/lp/soyuz/doc/gina.txt 2013-09-20 05:25:18 +0000 |
1554 | +++ lib/lp/soyuz/doc/gina.txt 2013-09-26 04:04:44 +0000 |
1555 | @@ -35,7 +35,7 @@ |
1556 | |
1557 | Create a distribution release and an arch release for breezy: |
1558 | |
1559 | - >>> from lp.soyuz.model.processor import ProcessorFamily |
1560 | + >>> from lp.soyuz.interfaces.processor import IProcessorSet |
1561 | >>> from lp.app.interfaces.launchpad import ILaunchpadCelebrities |
1562 | >>> celebs = getUtility(ILaunchpadCelebrities) |
1563 | >>> ubuntu = celebs.ubuntu |
1564 | @@ -49,9 +49,9 @@ |
1565 | ... hoary, celebs.launchpad_developers) |
1566 | >>> login(ANONYMOUS) |
1567 | |
1568 | - >>> pf = ProcessorFamily.selectOneBy(name="x86") |
1569 | >>> breezy_i386 = breezy.newArch( |
1570 | - ... processorfamily=pf, architecturetag="i386", official=True, |
1571 | + ... processor=getUtility(IProcessorSet).getByName('386'), |
1572 | + ... architecturetag="i386", official=True, |
1573 | ... owner=celebs.launchpad_developers) |
1574 | >>> import transaction |
1575 | >>> transaction.commit() |
1576 | @@ -402,8 +402,8 @@ |
1577 | 386 |
1578 | >>> print ed.build.status |
1579 | Successfully built |
1580 | - >>> print ed.build.distro_arch_series.processorfamily.name |
1581 | - x86 |
1582 | + >>> print ed.build.distro_arch_series.processor.name |
1583 | + 386 |
1584 | >>> print ed.build.distro_arch_series.architecturetag |
1585 | i386 |
1586 | >>> print ed.priority |
1587 | @@ -724,9 +724,9 @@ |
1588 | in production, i.e., just creating 'lenny' should suffice for the |
1589 | source-only import to happen. |
1590 | |
1591 | - >>> pf = ProcessorFamily.selectOneBy(name="x86") |
1592 | >>> lenny_i386 = lenny.newArch( |
1593 | - ... processorfamily=pf, architecturetag="i386", official=True, |
1594 | + ... processor=getUtility(IProcessorSet).getByName('386'), |
1595 | + ... architecturetag="i386", official=True, |
1596 | ... owner=celebs.launchpad_developers) |
1597 | |
1598 | We will also store the number of binaries already published in debian |
1599 | |
1600 | === removed file 'lib/lp/soyuz/doc/processor.txt' |
1601 | --- lib/lp/soyuz/doc/processor.txt 2009-04-28 12:59:43 +0000 |
1602 | +++ lib/lp/soyuz/doc/processor.txt 1970-01-01 00:00:00 +0000 |
1603 | @@ -1,39 +0,0 @@ |
1604 | -The `IProcessorFamilySet` utility allows the look-up of ProcessorFamily |
1605 | -instances by name. |
1606 | - |
1607 | - >>> from zope.component import getUtility |
1608 | - >>> from lp.soyuz.interfaces.processor import ( |
1609 | - ... IProcessorFamilySet) |
1610 | - |
1611 | - >>> pfs = getUtility(IProcessorFamilySet) |
1612 | - |
1613 | -The attempt to access a non-existing processor family yields None. |
1614 | - |
1615 | - >>> print pfs.getByName('this-processor-family-does-not-exist') |
1616 | - None |
1617 | - |
1618 | -Conversely, accessing an existing processor family yields the instance. |
1619 | - |
1620 | - >>> family = pfs.getByName('x86') |
1621 | - >>> family.name |
1622 | - u'x86' |
1623 | - >>> family.title |
1624 | - u'Intel 386 compatible chips' |
1625 | - >>> family.description |
1626 | - u'Bring back the 8086!' |
1627 | - |
1628 | -It is also possible to get the processor family for a given processor. |
1629 | - |
1630 | - >>> family = pfs.getByProcessorName('386') |
1631 | - >>> family.name |
1632 | - u'x86' |
1633 | - >>> family.title |
1634 | - u'Intel 386 compatible chips' |
1635 | - >>> family.description |
1636 | - u'Bring back the 8086!' |
1637 | - |
1638 | -In case where the user specifies a non-existent processor name the return |
1639 | -value will be None. |
1640 | - |
1641 | - >>> print pfs.getByProcessorName('wintel') |
1642 | - None |
1643 | |
1644 | === modified file 'lib/lp/soyuz/doc/soyuz-set-of-uploads.txt' |
1645 | --- lib/lp/soyuz/doc/soyuz-set-of-uploads.txt 2013-05-01 18:39:38 +0000 |
1646 | +++ lib/lp/soyuz/doc/soyuz-set-of-uploads.txt 2013-09-26 04:04:44 +0000 |
1647 | @@ -514,13 +514,11 @@ |
1648 | will need to build a new DistroArchSeries for powerpc in |
1649 | ubuntutest/breezy. |
1650 | |
1651 | - >>> from lp.soyuz.model.processor import ( |
1652 | - ... ProcessorFamily, Processor) |
1653 | - >>> powerpc_pf = ProcessorFamily.selectOneBy(name='powerpc') |
1654 | - >>> powerpc_proc = Processor(family=powerpc_pf, name='powerpc', |
1655 | - ... title='PowerPC G3/G4', description='G3/G4') |
1656 | + >>> from lp.soyuz.model.processor import Processor |
1657 | + >>> powerpc = Processor( |
1658 | + ... name='powerpc', title='PowerPC G3/G4', description='G3/G4') |
1659 | >>> powerpc_dar = breezy.newArch( |
1660 | - ... 'powerpc', powerpc_pf, True, breezy.owner) |
1661 | + ... 'powerpc', powerpc, True, breezy.owner) |
1662 | |
1663 | After having the respective DistroArchSeries in place we will submit a |
1664 | binary upload for the last source in BACKPORTS. The ancestry should be |
1665 | |
1666 | === modified file 'lib/lp/soyuz/interfaces/archive.py' |
1667 | --- lib/lp/soyuz/interfaces/archive.py 2013-09-13 07:07:25 +0000 |
1668 | +++ lib/lp/soyuz/interfaces/archive.py 2013-09-26 04:04:44 +0000 |
1669 | @@ -590,14 +590,14 @@ |
1670 | "context build.\n" |
1671 | "NOTE: This is for migration of OEM PPAs only!"))) |
1672 | |
1673 | - enabled_restricted_families = exported( |
1674 | + enabled_restricted_processors = exported( |
1675 | CollectionField( |
1676 | - title=_("Enabled restricted families"), |
1677 | + title=_("Enabled restricted processors"), |
1678 | description=_( |
1679 | - "The restricted architecture families on which the archive " |
1680 | + "The restricted architectures on which the archive " |
1681 | "can build."), |
1682 | value_type=Reference(schema=Interface), |
1683 | - # Really IProcessorFamily. |
1684 | + # Really IProcessor. |
1685 | readonly=True), |
1686 | as_of='devel') |
1687 | |
1688 | @@ -1973,15 +1973,15 @@ |
1689 | """Archive interface for operations restricted by commercial.""" |
1690 | |
1691 | @operation_parameters( |
1692 | - family=Reference(schema=Interface, required=True), |
1693 | - # Really IProcessorFamily. |
1694 | + processor=Reference(schema=Interface, required=True), |
1695 | + # Really IProcessor. |
1696 | ) |
1697 | @export_write_operation() |
1698 | @operation_for_version('devel') |
1699 | - def enableRestrictedFamily(family): |
1700 | - """Add the processor family to the set of enabled restricted families. |
1701 | + def enableRestrictedProcessor(processor): |
1702 | + """Add the processor to the set of enabled restricted processors. |
1703 | |
1704 | - :param family: is an `IProcessorFamily` object. |
1705 | + :param processor: is an `IProcessor` object. |
1706 | """ |
1707 | |
1708 | @operation_parameters( |
1709 | |
1710 | === modified file 'lib/lp/soyuz/interfaces/archivearch.py' |
1711 | --- lib/lp/soyuz/interfaces/archivearch.py 2013-09-10 05:00:15 +0000 |
1712 | +++ lib/lp/soyuz/interfaces/archivearch.py 2013-09-26 04:04:44 +0000 |
1713 | @@ -16,14 +16,11 @@ |
1714 | |
1715 | from lp import _ |
1716 | from lp.soyuz.interfaces.archive import IArchive |
1717 | -from lp.soyuz.interfaces.processor import ( |
1718 | - IProcessor, |
1719 | - IProcessorFamily, |
1720 | - ) |
1721 | +from lp.soyuz.interfaces.processor import IProcessor |
1722 | |
1723 | |
1724 | class IArchiveArch(Interface): |
1725 | - """An interface for archive/processor family associations.""" |
1726 | + """An interface for archive/processor associations.""" |
1727 | |
1728 | id = Int(title=_('ID'), required=True, readonly=True) |
1729 | |
1730 | @@ -31,51 +28,45 @@ |
1731 | title=_("Archive"), schema=IArchive, |
1732 | required=True, readonly=True, |
1733 | description=_( |
1734 | - "The archive associated with the processor family at hand.")) |
1735 | - |
1736 | - processorfamily = Reference( |
1737 | - title=_("Processor family"), schema=IProcessorFamily, |
1738 | - required=True, readonly=True, |
1739 | - description=_( |
1740 | - "The processorfamily associated with the archive at hand.")) |
1741 | + "The archive associated with the processor at hand.")) |
1742 | |
1743 | processor = Reference( |
1744 | title=_("Processor"), schema=IProcessor, |
1745 | - required=False, readonly=True, |
1746 | + required=True, readonly=True, |
1747 | description=_( |
1748 | "The processor associated with the archive at hand.")) |
1749 | |
1750 | |
1751 | class IArchiveArchSet(Interface): |
1752 | - """An interface for sets of archive/processor family associations.""" |
1753 | - def new(archive, processorfamily): |
1754 | - """Create a new archive/processor family association. |
1755 | + """An interface for sets of archive/processor associations.""" |
1756 | + def new(archive, processor): |
1757 | + """Create a new archive/processor association. |
1758 | |
1759 | :param archive: the archive to be associated. |
1760 | - :param processorfamily: the processor family to be associated. |
1761 | + :param processor: the processor to be associated. |
1762 | |
1763 | :return: a newly created `IArchiveArch`. |
1764 | """ |
1765 | |
1766 | - def getByArchive(archive, processorfamily=None): |
1767 | - """Return associations that match the archive and processor family. |
1768 | + def getByArchive(archive, processor=None): |
1769 | + """Return associations that match the archive and processor. |
1770 | |
1771 | - If no processor family is passed, all associations for 'archive' will |
1772 | + If no processor is passed, all associations for 'archive' will |
1773 | be returned. |
1774 | |
1775 | :param archive: The associated archive. |
1776 | - :param processorfamily: An optional processor family; if passed only |
1777 | + :param processor: An optional processor; if passed only |
1778 | associations in which it participates will be considered. |
1779 | |
1780 | :return: A (potentially empty) result set of `IArchiveArch` instances. |
1781 | """ |
1782 | |
1783 | - def getRestrictedFamilies(archive): |
1784 | - """All restricted processor families, paired with `ArchiveArch` |
1785 | + def getRestrictedProcessors(archive): |
1786 | + """All restricted processor, paired with `ArchiveArch` |
1787 | instances if associated with `archive`. |
1788 | |
1789 | - :return: A sequence containing a (`ProcessorFamily`, `ArchiveArch`) |
1790 | - 2-tuple for each processor family. |
1791 | + :return: A sequence containing a (`Processor`, `ArchiveArch`) |
1792 | + 2-tuple for each processor. |
1793 | The second value in the tuple will be None if the given `archive` |
1794 | - is not associated with the `ProcessorFamily` yet. |
1795 | + is not associated with the `Processor` yet. |
1796 | """ |
1797 | |
1798 | === modified file 'lib/lp/soyuz/interfaces/distroarchseries.py' |
1799 | --- lib/lp/soyuz/interfaces/distroarchseries.py 2013-09-10 05:00:15 +0000 |
1800 | +++ lib/lp/soyuz/interfaces/distroarchseries.py 2013-09-26 04:04:44 +0000 |
1801 | @@ -56,11 +56,8 @@ |
1802 | IDistroSeries, |
1803 | title=_("The context distroseries"), |
1804 | required=False, readonly=False)) |
1805 | - processorfamily = Choice( |
1806 | - title=_("Processor Family"), |
1807 | - required=True, vocabulary='ProcessorFamily') |
1808 | processor = Choice( |
1809 | - title=_("Processor"), required=False, vocabulary='Processor') |
1810 | + title=_("Processor"), required=True, vocabulary='Processor') |
1811 | architecturetag = exported( |
1812 | TextLine( |
1813 | title=_("Architecture Tag"), |
1814 | @@ -129,12 +126,6 @@ |
1815 | 'True if this distroarchseries is the NominatedArchIndep ' |
1816 | 'one.')), |
1817 | exported_as="is_nominated_arch_indep") |
1818 | - default_processor = Attribute( |
1819 | - "Return the DistroArchSeries default processor, by picking the " |
1820 | - "first processor inside its processorfamily.") |
1821 | - processors = Attribute( |
1822 | - "The group of Processors for this DistroArchSeries.processorfamily." |
1823 | - ) |
1824 | main_archive = exported( |
1825 | Reference( |
1826 | Interface, # Really IArchive, circular import fixed below. |
1827 | |
1828 | === modified file 'lib/lp/soyuz/interfaces/packagecloner.py' |
1829 | --- lib/lp/soyuz/interfaces/packagecloner.py 2013-01-07 02:40:55 +0000 |
1830 | +++ lib/lp/soyuz/interfaces/packagecloner.py 2013-09-26 04:04:44 +0000 |
1831 | @@ -16,7 +16,7 @@ |
1832 | """Copies publishing history data across archives.""" |
1833 | |
1834 | def clonePackages(origin, destination, distroarchseries_list=None, |
1835 | - proc_families=None, sourcepackagenames=None, |
1836 | + processors=None, sourcepackagenames=None, |
1837 | always_create=False): |
1838 | """Copy packages from origin to destination. |
1839 | |
1840 | @@ -27,8 +27,7 @@ |
1841 | :param destination: the location to which the data is to be copied. |
1842 | :param distroarchseries_list: the binary packages will be copied |
1843 | for the distroarchseries pairs specified (if any). |
1844 | - :param proc_families: the processor families that builds will be |
1845 | - created for. |
1846 | + :param processors: the processors that builds will be created for. |
1847 | :param sourcepackagenames: the source packages which are to be |
1848 | copied. |
1849 | :param always_create: if builds should always be created. |
1850 | |
1851 | === modified file 'lib/lp/soyuz/interfaces/processor.py' |
1852 | --- lib/lp/soyuz/interfaces/processor.py 2013-09-10 05:00:15 +0000 |
1853 | +++ lib/lp/soyuz/interfaces/processor.py 2013-09-26 04:04:44 +0000 |
1854 | @@ -7,8 +7,6 @@ |
1855 | |
1856 | __all__ = [ |
1857 | 'IProcessor', |
1858 | - 'IProcessorFamily', |
1859 | - 'IProcessorFamilySet', |
1860 | 'IProcessorSet', |
1861 | 'ProcessorNotFound', |
1862 | ] |
1863 | @@ -23,10 +21,6 @@ |
1864 | operation_parameters, |
1865 | operation_returns_entry, |
1866 | ) |
1867 | -from lazr.restful.fields import ( |
1868 | - CollectionField, |
1869 | - Reference, |
1870 | - ) |
1871 | from zope.interface import ( |
1872 | Attribute, |
1873 | Interface, |
1874 | @@ -57,14 +51,6 @@ |
1875 | # 'devel' as their version. |
1876 | export_as_webservice_entry(publish_web_link=False, as_of='beta') |
1877 | id = Attribute("The Processor ID") |
1878 | - family = exported( |
1879 | - Reference( |
1880 | - schema=Interface, |
1881 | - # Really IProcessorFamily. |
1882 | - required=True, readonly=True, |
1883 | - title=_("Processor Family"), |
1884 | - description=_("The Processor Family Reference")), |
1885 | - as_of='devel', readonly=True) |
1886 | name = exported( |
1887 | TextLine(title=_("Name"), |
1888 | description=_("The Processor Name")), |
1889 | @@ -82,56 +68,6 @@ |
1890 | as_of='devel', readonly=True) |
1891 | |
1892 | |
1893 | -class IProcessorFamily(Interface): |
1894 | - """The SQLObject ProcessorFamily Interface""" |
1895 | - |
1896 | - # XXX: BradCrittenden 2011-06-20 bug=760849: The following use of 'beta' |
1897 | - # is a work-around to allow the WADL to be generated. It is a bald-faced |
1898 | - # lie, though. The class is being exported in 'devel' but in order to get |
1899 | - # the WADL generation work it must be back-dated to the earliest version. |
1900 | - # Note that individual attributes and methods can and must truthfully set |
1901 | - # 'devel' as their version. |
1902 | - export_as_webservice_entry( |
1903 | - plural_name='processor_families', |
1904 | - publish_web_link=False, |
1905 | - as_of='beta') |
1906 | - |
1907 | - id = Attribute("The ProcessorFamily ID") |
1908 | - name = exported( |
1909 | - TextLine( |
1910 | - title=_("Name"), |
1911 | - description=_("The Processor Family Name")), |
1912 | - as_of='devel', readonly=True) |
1913 | - title = exported( |
1914 | - TextLine( |
1915 | - title=_("Title"), |
1916 | - description=_("The Processor Family Title")), |
1917 | - as_of='devel', readonly=True) |
1918 | - description = exported( |
1919 | - Text( |
1920 | - title=_("Description"), |
1921 | - description=_("The Processor Name Description")), |
1922 | - as_of='devel', readonly=True) |
1923 | - processors = exported( |
1924 | - CollectionField( |
1925 | - title=_("Processors"), |
1926 | - description=_("The Processors in this family."), |
1927 | - value_type=Reference(IProcessor)), |
1928 | - as_of='devel', readonly=True) |
1929 | - restricted = exported( |
1930 | - Bool(title=_("Whether this family is restricted.")), |
1931 | - as_of='devel', readonly=True) |
1932 | - |
1933 | - def addProcessor(name, title, description): |
1934 | - """Add a new processor to this family. |
1935 | - |
1936 | - :param name: Name of the processor |
1937 | - :param title: Title of the processor |
1938 | - :param description: Description of the processor |
1939 | - :return: A `IProcessor` |
1940 | - """ |
1941 | - |
1942 | - |
1943 | class IProcessorSet(Interface): |
1944 | """Operations related to Processor instances.""" |
1945 | export_as_webservice_collection(IProcessor) |
1946 | @@ -153,46 +89,15 @@ |
1947 | def getAll(): |
1948 | """Return all the `IProcessor` known to Launchpad.""" |
1949 | |
1950 | - |
1951 | -class IProcessorFamilySet(Interface): |
1952 | - """Operations related to ProcessorFamily instances.""" |
1953 | - |
1954 | - export_as_webservice_collection(IProcessorFamily) |
1955 | - |
1956 | - @operation_parameters( |
1957 | - name=TextLine(required=True)) |
1958 | - @operation_returns_entry(IProcessorFamily) |
1959 | - @export_read_operation() |
1960 | - @operation_for_version('devel') |
1961 | - def getByName(name): |
1962 | - """Return the ProcessorFamily instance with the matching name. |
1963 | - |
1964 | - :param name: The name to look for. |
1965 | - |
1966 | - :return: A `IProcessorFamily` instance if found, None otherwise. |
1967 | - """ |
1968 | - |
1969 | - @collection_default_content() |
1970 | def getRestricted(): |
1971 | - """Return a sequence of all restricted architectures. |
1972 | - |
1973 | - :return: A sequence of `IProcessorFamily` instances. |
1974 | - """ |
1975 | - |
1976 | - def getByProcessorName(name): |
1977 | - """Given a processor name return the ProcessorFamily it belongs to. |
1978 | - |
1979 | - :param name: The name of the processor to look for. |
1980 | - |
1981 | - :return: A `IProcessorFamily` instance if found, None otherwise. |
1982 | - """ |
1983 | + """Return all restricted `IProcessor`s.""" |
1984 | |
1985 | def new(name, title, description, restricted): |
1986 | - """Create a new processor family. |
1987 | + """Create a new processor. |
1988 | |
1989 | - :param name: Name of the family. |
1990 | - :param title: Title for the family. |
1991 | - :param description: Extended description of the family |
1992 | - :param restricted: Whether the processor family is restricted |
1993 | - :return: a `IProcessorFamily`. |
1994 | + :param name: Name of the processor. |
1995 | + :param title: Title for the processor. |
1996 | + :param description: Extended description of the processor. |
1997 | + :param restricted: Whether the processor is restricted. |
1998 | + :return: a `IProcessor`. |
1999 | """ |
2000 | |
2001 | === modified file 'lib/lp/soyuz/interfaces/webservice.py' |
2002 | --- lib/lp/soyuz/interfaces/webservice.py 2013-09-13 07:07:25 +0000 |
2003 | +++ lib/lp/soyuz/interfaces/webservice.py 2013-09-26 04:04:44 +0000 |
2004 | @@ -33,8 +33,6 @@ |
2005 | 'IPackageset', |
2006 | 'IPackagesetSet', |
2007 | 'IProcessor', |
2008 | - 'IProcessorFamily', |
2009 | - 'IProcessorFamilySet', |
2010 | 'IProcessorSet', |
2011 | 'ISourcePackagePublishingHistory', |
2012 | 'IncompatibleArguments', |
2013 | @@ -96,8 +94,6 @@ |
2014 | ) |
2015 | from lp.soyuz.interfaces.processor import ( |
2016 | IProcessor, |
2017 | - IProcessorFamily, |
2018 | - IProcessorFamilySet, |
2019 | IProcessorSet, |
2020 | ) |
2021 | from lp.soyuz.interfaces.publishing import ( |
2022 | |
2023 | === modified file 'lib/lp/soyuz/model/archive.py' |
2024 | --- lib/lp/soyuz/model/archive.py 2013-09-13 07:07:25 +0000 |
2025 | +++ lib/lp/soyuz/model/archive.py 2013-09-26 04:04:44 +0000 |
2026 | @@ -1972,42 +1972,30 @@ |
2027 | LibraryFileContent.id == LibraryFileAlias.contentID).config( |
2028 | distinct=True)) |
2029 | |
2030 | - def _getEnabledRestrictedFamilies(self): |
2031 | - """Retrieve the restricted architecture families this archive can |
2032 | - build on.""" |
2033 | - families = getUtility(IArchiveArchSet).getRestrictedFamilies(self) |
2034 | + def _getEnabledRestrictedProcessors(self): |
2035 | + """Retrieve the restricted architectures this archive can build on.""" |
2036 | + processors = getUtility(IArchiveArchSet).getRestrictedProcessors(self) |
2037 | return [ |
2038 | - family for (family, archive_arch) in families |
2039 | + processor for (processor, archive_arch) in processors |
2040 | if archive_arch is not None] |
2041 | |
2042 | - def _setEnabledRestrictedFamilies(self, value): |
2043 | - """Set the restricted architecture families this archive can |
2044 | - build on.""" |
2045 | + def _setEnabledRestrictedProcessors(self, value): |
2046 | + """Set the restricted architectures this archive can build on.""" |
2047 | archive_arch_set = getUtility(IArchiveArchSet) |
2048 | - restricted_families = archive_arch_set.getRestrictedFamilies(self) |
2049 | - for (family, archive_arch) in restricted_families: |
2050 | - if family in value and archive_arch is None: |
2051 | - archive_arch_set.new(self, family) |
2052 | - if family not in value and archive_arch is not None: |
2053 | + restricted_processors = archive_arch_set.getRestrictedProcessors(self) |
2054 | + for (processor, archive_arch) in restricted_processors: |
2055 | + if processor in value and archive_arch is None: |
2056 | + archive_arch_set.new(self, processor) |
2057 | + if processor not in value and archive_arch is not None: |
2058 | Store.of(self).remove(archive_arch) |
2059 | |
2060 | - enabled_restricted_families = property(_getEnabledRestrictedFamilies, |
2061 | - _setEnabledRestrictedFamilies) |
2062 | - |
2063 | - @property |
2064 | - def enabled_restricted_processors(self): |
2065 | - return [ |
2066 | - family.processors[0] |
2067 | - for family in self.enabled_restricted_families] |
2068 | - |
2069 | - def enableRestrictedFamily(self, family): |
2070 | - """See `IArchive`.""" |
2071 | - restricted = set(self.enabled_restricted_families) |
2072 | - restricted.add(family) |
2073 | - self.enabled_restricted_families = restricted |
2074 | + enabled_restricted_processors = property( |
2075 | + _getEnabledRestrictedProcessors, _setEnabledRestrictedProcessors) |
2076 | |
2077 | def enableRestrictedProcessor(self, processor): |
2078 | - self.enableRestrictedFamily(processor.family) |
2079 | + """See `IArchive`.""" |
2080 | + self.enabled_restricted_processors = set( |
2081 | + self.enabled_restricted_processors + [processor]) |
2082 | |
2083 | def getPockets(self): |
2084 | """See `IArchive`.""" |
2085 | |
2086 | === modified file 'lib/lp/soyuz/model/archivearch.py' |
2087 | --- lib/lp/soyuz/model/archivearch.py 2013-09-25 06:54:24 +0000 |
2088 | +++ lib/lp/soyuz/model/archivearch.py 2013-09-26 04:04:44 +0000 |
2089 | @@ -34,22 +34,18 @@ |
2090 | |
2091 | archive_id = Int(name='archive', allow_none=False) |
2092 | archive = Reference(archive_id, 'Archive.id') |
2093 | - processorfamily_id = Int(name='processorfamily', allow_none=True) |
2094 | - processorfamily = Reference(processorfamily_id, 'ProcessorFamily.id') |
2095 | - processor_id = Int(name='processor', allow_none=True) |
2096 | - processor = Reference(processor_id, 'Processor.id') |
2097 | + processor_id = Int(name='processor', allow_none=False) |
2098 | + processor = Reference(processor_id, Processor.id) |
2099 | |
2100 | |
2101 | class ArchiveArchSet: |
2102 | """See `IArchiveArchSet`.""" |
2103 | implements(IArchiveArchSet) |
2104 | |
2105 | - def new(self, archive, processorfamily): |
2106 | + def new(self, archive, processor): |
2107 | """See `IArchiveArchSet`.""" |
2108 | - processor = processorfamily.processors[0] |
2109 | archivearch = ArchiveArch() |
2110 | archivearch.archive = archive |
2111 | - archivearch.processorfamily = processorfamily |
2112 | archivearch.processor = processor |
2113 | IStore(ArchiveArch).add(archivearch) |
2114 | return archivearch |
2115 | @@ -63,14 +59,14 @@ |
2116 | return IStore(ArchiveArch).find(ArchiveArch, *clauses).order_by( |
2117 | ArchiveArch.id) |
2118 | |
2119 | - def getRestrictedFamilies(self, archive): |
2120 | + def getRestrictedProcessors(self, archive): |
2121 | """See `IArchiveArchSet`.""" |
2122 | origin = ( |
2123 | - ProcessorFamily, |
2124 | + Processor, |
2125 | LeftJoin( |
2126 | ArchiveArch, |
2127 | And(ArchiveArch.archive == archive.id, |
2128 | - ArchiveArch.processorfamily == ProcessorFamily.id))) |
2129 | + ArchiveArch.processor == Processor.id))) |
2130 | return IStore(ArchiveArch).using(*origin).find( |
2131 | - (ProcessorFamily, ArchiveArch), |
2132 | - ProcessorFamily.restricted == True).order_by(ProcessorFamily.name) |
2133 | + (Processor, ArchiveArch), |
2134 | + Processor.restricted == True).order_by(Processor.name) |
2135 | |
2136 | === modified file 'lib/lp/soyuz/model/distroarchseries.py' |
2137 | --- lib/lp/soyuz/model/distroarchseries.py 2013-09-10 05:00:15 +0000 |
2138 | +++ lib/lp/soyuz/model/distroarchseries.py 2013-09-26 04:04:44 +0000 |
2139 | @@ -68,9 +68,7 @@ |
2140 | |
2141 | distroseries = ForeignKey(dbName='distroseries', |
2142 | foreignKey='DistroSeries', notNull=True) |
2143 | - processorfamily = ForeignKey(dbName='processorfamily', |
2144 | - foreignKey='ProcessorFamily', notNull=True) |
2145 | - processor_id = Int(name='processor', allow_none=True) |
2146 | + processor_id = Int(name='processor', allow_none=False) |
2147 | processor = Reference(processor_id, Processor.id) |
2148 | architecturetag = StringCol(notNull=True) |
2149 | official = BoolCol(notNull=True) |
2150 | @@ -90,27 +88,10 @@ |
2151 | return self.getBinaryPackage(name) |
2152 | |
2153 | @property |
2154 | - def default_processor(self): |
2155 | - """See `IDistroArchSeries`.""" |
2156 | - # XXX cprov 2005-08-31: |
2157 | - # This could possibly be better designed; let's think about it in |
2158 | - # the future. Pick the first processor we found for this |
2159 | - # distroarchseries.processorfamily. The data model should |
2160 | - # change to have a default processor for a processorfamily |
2161 | - return self.processors[0] |
2162 | - |
2163 | - @property |
2164 | - def processors(self): |
2165 | - """See `IDistroArchSeries`.""" |
2166 | - return Processor.selectBy(family=self.processorfamily, orderBy='id') |
2167 | - |
2168 | - @property |
2169 | def title(self): |
2170 | """See `IDistroArchSeries`.""" |
2171 | return '%s for %s (%s)' % ( |
2172 | - self.distroseries.title, self.architecturetag, |
2173 | - self.processorfamily.name |
2174 | - ) |
2175 | + self.distroseries.title, self.architecturetag, self.processor.name) |
2176 | |
2177 | @property |
2178 | def displayname(self): |
2179 | |
2180 | === modified file 'lib/lp/soyuz/model/packagecloner.py' |
2181 | --- lib/lp/soyuz/model/packagecloner.py 2013-06-20 05:50:00 +0000 |
2182 | +++ lib/lp/soyuz/model/packagecloner.py 2013-09-26 04:04:44 +0000 |
2183 | @@ -58,7 +58,7 @@ |
2184 | implements(IPackageCloner) |
2185 | |
2186 | def clonePackages(self, origin, destination, distroarchseries_list=None, |
2187 | - proc_families=None, sourcepackagenames=None, |
2188 | + processors=None, sourcepackagenames=None, |
2189 | always_create=False): |
2190 | """Copies packages from origin to destination package location. |
2191 | |
2192 | @@ -73,8 +73,8 @@ |
2193 | distroarchseries instances. |
2194 | @param distroarchseries_list: the binary packages will be copied |
2195 | for the distroarchseries pairs specified (if any). |
2196 | - @param proc_families: the processor families to create builds for. |
2197 | - @type proc_families: Iterable |
2198 | + @param processors: the processors to create builds for. |
2199 | + @type processors: Iterable |
2200 | @param sourcepackagenames: the sourcepackages to copy to the |
2201 | destination |
2202 | @type sourcepackagenames: Iterable |
2203 | @@ -94,22 +94,21 @@ |
2204 | origin, destination, origin_das, destination_das, |
2205 | sourcepackagenames) |
2206 | |
2207 | - if proc_families is None: |
2208 | - proc_families = [] |
2209 | + if processors is None: |
2210 | + processors = [] |
2211 | |
2212 | self._create_missing_builds( |
2213 | destination.distroseries, destination.archive, |
2214 | - distroarchseries_list, proc_families, always_create) |
2215 | + distroarchseries_list, processors, always_create) |
2216 | |
2217 | - def _create_missing_builds( |
2218 | - self, distroseries, archive, distroarchseries_list, |
2219 | - proc_families, always_create): |
2220 | + def _create_missing_builds(self, distroseries, archive, |
2221 | + distroarchseries_list, processors, |
2222 | + always_create): |
2223 | """Create builds for all cloned source packages. |
2224 | |
2225 | :param distroseries: the distro series for which to create builds. |
2226 | :param archive: the archive for which to create builds. |
2227 | - :param proc_families: the list of processor families for |
2228 | - which to create builds. |
2229 | + :param processors: the list of processors for which to create builds. |
2230 | """ |
2231 | # Avoid circular imports. |
2232 | from lp.soyuz.interfaces.publishing import active_publishing_status |
2233 | @@ -119,9 +118,9 @@ |
2234 | architectures = list(distroseries.architectures) |
2235 | |
2236 | # Filter the list of DistroArchSeries so that only the ones |
2237 | - # specified in proc_families remain |
2238 | + # specified in processors remain. |
2239 | architectures = [architecture for architecture in architectures |
2240 | - if architecture.processorfamily in proc_families] |
2241 | + if architecture.processor in processors] |
2242 | |
2243 | if len(architectures) == 0: |
2244 | return |
2245 | @@ -264,17 +263,13 @@ |
2246 | """ % sqlvalues( |
2247 | PackagePublishingStatus.SUPERSEDED, UTC_NOW)) |
2248 | |
2249 | - def get_family(archivearch): |
2250 | - """Extract the processor family from an `IArchiveArch`.""" |
2251 | - return removeSecurityProxy(archivearch).processorfamily |
2252 | - |
2253 | - proc_families = [ |
2254 | - get_family(archivearch) for archivearch |
2255 | + processors = [ |
2256 | + removeSecurityProxy(archivearch).processor for archivearch |
2257 | in getUtility(IArchiveArchSet).getByArchive(destination.archive)] |
2258 | |
2259 | self._create_missing_builds( |
2260 | destination.distroseries, destination.archive, (), |
2261 | - proc_families, False) |
2262 | + processors, False) |
2263 | |
2264 | def _compute_packageset_delta(self, origin): |
2265 | """Given a source/target archive find obsolete or missing packages. |
2266 | |
2267 | === modified file 'lib/lp/soyuz/model/processor.py' |
2268 | --- lib/lp/soyuz/model/processor.py 2013-09-10 05:00:15 +0000 |
2269 | +++ lib/lp/soyuz/model/processor.py 2013-09-26 04:04:44 +0000 |
2270 | @@ -4,15 +4,10 @@ |
2271 | __metaclass__ = type |
2272 | __all__ = [ |
2273 | 'Processor', |
2274 | - 'ProcessorFamily', |
2275 | - 'ProcessorFamilySet' |
2276 | + 'ProcessorSet', |
2277 | ] |
2278 | |
2279 | -from sqlobject import ( |
2280 | - ForeignKey, |
2281 | - SQLMultipleJoin, |
2282 | - StringCol, |
2283 | - ) |
2284 | +from sqlobject import StringCol |
2285 | from storm.locals import Bool |
2286 | from zope.interface import implements |
2287 | |
2288 | @@ -20,8 +15,6 @@ |
2289 | from lp.services.database.sqlbase import SQLBase |
2290 | from lp.soyuz.interfaces.processor import ( |
2291 | IProcessor, |
2292 | - IProcessorFamily, |
2293 | - IProcessorFamilySet, |
2294 | IProcessorSet, |
2295 | ProcessorNotFound, |
2296 | ) |
2297 | @@ -31,12 +24,10 @@ |
2298 | implements(IProcessor) |
2299 | _table = 'Processor' |
2300 | |
2301 | - family = ForeignKey(dbName='family', foreignKey='ProcessorFamily', |
2302 | - notNull=True) |
2303 | name = StringCol(dbName='name', notNull=True) |
2304 | title = StringCol(dbName='title', notNull=True) |
2305 | description = StringCol(dbName='description', notNull=True) |
2306 | - restricted = Bool(allow_none=True, default=False) |
2307 | + restricted = Bool(allow_none=False, default=False) |
2308 | |
2309 | def __repr__(self): |
2310 | return "<Processor %r>" % self.title |
2311 | @@ -58,54 +49,12 @@ |
2312 | """See `IProcessorSet`.""" |
2313 | return IStore(Processor).find(Processor) |
2314 | |
2315 | - |
2316 | -class ProcessorFamily(SQLBase): |
2317 | - implements(IProcessorFamily) |
2318 | - _table = 'ProcessorFamily' |
2319 | - |
2320 | - name = StringCol(dbName='name', notNull=True) |
2321 | - title = StringCol(dbName='title', notNull=True) |
2322 | - description = StringCol(dbName='description', notNull=True) |
2323 | - |
2324 | - processors = SQLMultipleJoin('Processor', joinColumn='family') |
2325 | - restricted = Bool(allow_none=False, default=False) |
2326 | - |
2327 | - def addProcessor(self, name, title, description): |
2328 | - """See `IProcessorFamily`.""" |
2329 | - return Processor(family=self, name=name, title=title, |
2330 | - description=description, restricted=self.restricted) |
2331 | - |
2332 | - def __repr__(self): |
2333 | - return "<ProcessorFamily %r>" % self.title |
2334 | - |
2335 | - |
2336 | -class ProcessorFamilySet: |
2337 | - implements(IProcessorFamilySet) |
2338 | - |
2339 | - def getByName(self, name): |
2340 | - """Please see `IProcessorFamilySet`.""" |
2341 | - # Please note that ProcessorFamily.name is unique i.e. the database |
2342 | - # will return a result set that's either empty or contains just one |
2343 | - # ProcessorFamily row. |
2344 | - return IStore(ProcessorFamily).find( |
2345 | - ProcessorFamily, ProcessorFamily.name == name).one() |
2346 | - |
2347 | def getRestricted(self): |
2348 | - """See `IProcessorFamilySet`.""" |
2349 | - return IStore(ProcessorFamily).find( |
2350 | - ProcessorFamily, ProcessorFamily.restricted == True) |
2351 | - |
2352 | - def getByProcessorName(self, name): |
2353 | - """Please see `IProcessorFamilySet`.""" |
2354 | - # Each `Processor` is associated with exactly one `ProcessorFamily` |
2355 | - # but there is also the possibility that the user specified a name for |
2356 | - # a non-existent processor. |
2357 | - return IStore(ProcessorFamily).find( |
2358 | - ProcessorFamily, |
2359 | - Processor.name == name, |
2360 | - Processor.family == ProcessorFamily.id).one() |
2361 | + """See `IProcessorSet`.""" |
2362 | + return IStore(Processor).find(Processor, Processor.restricted == True) |
2363 | |
2364 | def new(self, name, title, description, restricted=False): |
2365 | - """See `IProcessorFamily`.""" |
2366 | - return ProcessorFamily(name=name, title=title, |
2367 | - description=description, restricted=restricted) |
2368 | + """See `IProcessorSet`.""" |
2369 | + return Processor( |
2370 | + name=name, title=title, description=description, |
2371 | + restricted=restricted) |
2372 | |
2373 | === modified file 'lib/lp/soyuz/scripts/gina/handlers.py' |
2374 | --- lib/lp/soyuz/scripts/gina/handlers.py 2013-05-22 09:51:08 +0000 |
2375 | +++ lib/lp/soyuz/scripts/gina/handlers.py 2013-09-26 04:04:44 +0000 |
2376 | @@ -223,15 +223,7 @@ |
2377 | raise DataSetupError("Error finding distroarchseries for %s/%s" |
2378 | % (self.distroseries.name, archtag)) |
2379 | |
2380 | - # XXX kiko 2005-11-07: Is this really a selectOneBy? Can't there |
2381 | - # be multiple proessors per family? |
2382 | - processor = Processor.selectOneBy(familyID=dar.processorfamily.id) |
2383 | - if not processor: |
2384 | - raise DataSetupError("Unable to find a processor from the " |
2385 | - "processor family %s chosen from %s/%s" |
2386 | - % (dar.processorfamily.name, |
2387 | - self.distroseries.name, archtag)) |
2388 | - |
2389 | + processor = dar.processor |
2390 | info = {'distroarchseries': dar, 'processor': processor} |
2391 | self.archinfo[archtag] = info |
2392 | |
2393 | |
2394 | === modified file 'lib/lp/soyuz/scripts/initialize_distroseries.py' |
2395 | --- lib/lp/soyuz/scripts/initialize_distroseries.py 2013-09-20 05:25:18 +0000 |
2396 | +++ lib/lp/soyuz/scripts/initialize_distroseries.py 2013-09-26 04:04:44 +0000 |
2397 | @@ -380,12 +380,12 @@ |
2398 | sqlvalues(self.arches)) |
2399 | self._store.execute(""" |
2400 | INSERT INTO DistroArchSeries |
2401 | - (distroseries, processorfamily, processor, architecturetag, owner, |
2402 | - official, supports_virtualized) |
2403 | - SELECT %s, processorfamily, processor, architecturetag, %s, |
2404 | + (distroseries, processor, architecturetag, owner, official, |
2405 | + supports_virtualized) |
2406 | + SELECT %s, processor, architecturetag, %s, |
2407 | bool_and(official), bool_or(supports_virtualized) |
2408 | FROM DistroArchSeries WHERE enabled = TRUE %s |
2409 | - GROUP BY processorfamily, processor, architecturetag |
2410 | + GROUP BY processor, architecturetag |
2411 | """ % (sqlvalues(self.distroseries, self.distroseries.owner) |
2412 | + (das_filter, ))) |
2413 | self._store.flush() |
2414 | @@ -531,15 +531,14 @@ |
2415 | destination = PackageLocation( |
2416 | target_archive, self.distroseries.distribution, |
2417 | self.distroseries, PackagePublishingPocket.RELEASE) |
2418 | - proc_families = None |
2419 | + processors = None |
2420 | if self.rebuild: |
2421 | - proc_families = [ |
2422 | - das[1].processorfamily |
2423 | - for das in distroarchseries_list] |
2424 | + processors = [ |
2425 | + das[1].processor for das in distroarchseries_list] |
2426 | distroarchseries_list = () |
2427 | getUtility(IPackageCloner).clonePackages( |
2428 | origin, destination, distroarchseries_list, |
2429 | - proc_families, spns, self.rebuild) |
2430 | + processors, spns, self.rebuild) |
2431 | else: |
2432 | # There is only one available pocket in an unreleased |
2433 | # series. |
2434 | |
2435 | === modified file 'lib/lp/soyuz/scripts/populate_archive.py' |
2436 | --- lib/lp/soyuz/scripts/populate_archive.py 2012-08-08 11:49:05 +0000 |
2437 | +++ lib/lp/soyuz/scripts/populate_archive.py 2013-09-26 04:04:44 +0000 |
2438 | @@ -11,7 +11,6 @@ |
2439 | |
2440 | |
2441 | from zope.component import getUtility |
2442 | -from zope.security.proxy import removeSecurityProxy |
2443 | |
2444 | from lp.app.errors import NotFoundError |
2445 | from lp.app.validators.name import valid_name |
2446 | @@ -23,7 +22,10 @@ |
2447 | from lp.soyuz.interfaces.component import IComponentSet |
2448 | from lp.soyuz.interfaces.packagecloner import IPackageCloner |
2449 | from lp.soyuz.interfaces.packagecopyrequest import IPackageCopyRequestSet |
2450 | -from lp.soyuz.interfaces.processor import IProcessorFamilySet |
2451 | +from lp.soyuz.interfaces.processor import ( |
2452 | + IProcessorSet, |
2453 | + ProcessorNotFound, |
2454 | + ) |
2455 | from lp.soyuz.scripts.ftpmasterbase import ( |
2456 | SoyuzScript, |
2457 | SoyuzScriptError, |
2458 | @@ -90,25 +92,23 @@ |
2459 | copied to. |
2460 | """ |
2461 | |
2462 | - def loadProcessorFamilies(arch_tags): |
2463 | - """Load processor families for specified arch tags.""" |
2464 | - proc_family_set = getUtility(IProcessorFamilySet) |
2465 | - proc_families = set() |
2466 | + def loadProcessors(arch_tags): |
2467 | + """Load processors for specified arch tags.""" |
2468 | + processors = set() |
2469 | for name in arch_tags: |
2470 | - proc_family = proc_family_set.getByProcessorName(name) |
2471 | - if proc_family is None: |
2472 | + try: |
2473 | + processor = getUtility(IProcessorSet).getByName(name) |
2474 | + processors.add(processor) |
2475 | + except ProcessorNotFound: |
2476 | raise SoyuzScriptError( |
2477 | "Invalid architecture tag: '%s'" % name) |
2478 | - else: |
2479 | - proc_families.add(proc_family) |
2480 | - |
2481 | - return proc_families |
2482 | - |
2483 | - def set_archive_architectures(archive, proc_families): |
2484 | - """Associate the archive with the processor families.""" |
2485 | + return processors |
2486 | + |
2487 | + def set_archive_architectures(archive, processors): |
2488 | + """Associate the archive with the processors.""" |
2489 | aa_set = getUtility(IArchiveArchSet) |
2490 | - for proc_family in proc_families: |
2491 | - aa_set.new(archive, proc_family) |
2492 | + for processor in processors: |
2493 | + aa_set.new(archive, processor) |
2494 | |
2495 | def build_location(distro, suite, component, packageset_names=None): |
2496 | """Build and return package location.""" |
2497 | @@ -200,11 +200,11 @@ |
2498 | raise SoyuzScriptError( |
2499 | "error: architecture tags not specified.") |
2500 | |
2501 | - # First load the processor families for the specified arch tags |
2502 | + # First load the processors for the specified arch tags |
2503 | # from the database. This will fail if an invalid arch tag |
2504 | # name was specified on the command line; that's why it should be |
2505 | # done before creating the copy archive. |
2506 | - proc_families = loadProcessorFamilies(arch_tags) |
2507 | + processors = loadProcessors(arch_tags) |
2508 | |
2509 | # The copy archive is created in disabled mode. This gives the |
2510 | # archive owner the chance to tweak the build dependencies |
2511 | @@ -218,9 +218,9 @@ |
2512 | description=reason, enabled=False, |
2513 | require_virtualized=virtual) |
2514 | the_destination.archive = copy_archive |
2515 | - # Associate the newly created copy archive with the processor |
2516 | - # families specified by the user. |
2517 | - set_archive_architectures(copy_archive, proc_families) |
2518 | + # Associate the newly created copy archive with the processors |
2519 | + # specified by the user. |
2520 | + set_archive_architectures(copy_archive, processors) |
2521 | else: |
2522 | # Archive name clash! Creation requested for existing archive with |
2523 | # the same name and distribution. |
2524 | @@ -228,10 +228,9 @@ |
2525 | raise SoyuzScriptError( |
2526 | "error: archive '%s' already exists for '%s'." |
2527 | % (to_archive, the_destination.distribution.name)) |
2528 | - # The user is not supposed to specify processor families on the |
2529 | - # command line for existing copy archives. The processor families |
2530 | - # specified when the archive was created will be read from the |
2531 | - # database instead. |
2532 | + # The user is not supposed to specify processors on the command |
2533 | + # line for existing copy archives. The processors specified when |
2534 | + # the archive was created will be read from the database instead. |
2535 | if specified(arch_tags): |
2536 | raise SoyuzScriptError( |
2537 | "error: cannot specify architecture tags for *existing* " |
2538 | @@ -241,12 +240,6 @@ |
2539 | raise SoyuzScriptError( |
2540 | "error: cannot copy to disabled archive") |
2541 | |
2542 | - # The copy archive exists already, get the associated processor |
2543 | - # families. |
2544 | - def get_family(archivearch): |
2545 | - """Extract the processor family from an `IArchiveArch`.""" |
2546 | - return removeSecurityProxy(archivearch).processorfamily |
2547 | - |
2548 | # Now instantiate the package copy request that will capture the |
2549 | # archive population parameters in the database. |
2550 | pcr = getUtility(IPackageCopyRequestSet).new( |
2551 | @@ -265,7 +258,7 @@ |
2552 | pkg_cloner.mergeCopy(the_origin, the_destination) |
2553 | else: |
2554 | pkg_cloner.clonePackages( |
2555 | - the_origin, the_destination, proc_families=proc_families) |
2556 | + the_origin, the_destination, processors=processors) |
2557 | |
2558 | # Mark the package copy request as completed. |
2559 | pcr.markAsCompleted() |
2560 | |
2561 | === modified file 'lib/lp/soyuz/scripts/tests/test_copypackage.py' |
2562 | --- lib/lp/soyuz/scripts/tests/test_copypackage.py 2013-06-20 17:24:46 +0000 |
2563 | +++ lib/lp/soyuz/scripts/tests/test_copypackage.py 2013-09-26 04:04:44 +0000 |
2564 | @@ -1029,9 +1029,9 @@ |
2565 | nobby = self.factory.makeDistroSeries( |
2566 | distribution=self.test_publisher.ubuntutest, name='nobby') |
2567 | for arch in archs: |
2568 | - pf = self.factory.makeProcessorFamily(name='my_%s' % arch) |
2569 | + processor = self.factory.makeProcessor(name='my_%s' % arch) |
2570 | self.factory.makeDistroArchSeries( |
2571 | - distroseries=nobby, architecturetag=arch, processorfamily=pf) |
2572 | + distroseries=nobby, architecturetag=arch, processor=processor) |
2573 | nobby.nominatedarchindep = nobby[archs[0]] |
2574 | self.test_publisher.addFakeChroots(nobby) |
2575 | return nobby |
2576 | @@ -1736,7 +1736,7 @@ |
2577 | for das in self.series.architectures: |
2578 | self.factory.makeDistroArchSeries( |
2579 | distroseries=new_series, architecturetag=das.architecturetag, |
2580 | - processorfamily=das.processorfamily) |
2581 | + processor=das.processor) |
2582 | new_series.nominatedarchindep = new_series[ |
2583 | self.series.nominatedarchindep.architecturetag] |
2584 | new_das = self.factory.makeDistroArchSeries(distroseries=new_series) |
2585 | |
2586 | === modified file 'lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py' |
2587 | --- lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py 2013-09-12 02:29:55 +0000 |
2588 | +++ lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py 2013-09-26 04:04:44 +0000 |
2589 | @@ -27,7 +27,10 @@ |
2590 | IPackagesetSet, |
2591 | NoSuchPackageSet, |
2592 | ) |
2593 | -from lp.soyuz.interfaces.processor import IProcessorFamilySet |
2594 | +from lp.soyuz.interfaces.processor import ( |
2595 | + IProcessorSet, |
2596 | + ProcessorNotFound, |
2597 | + ) |
2598 | from lp.soyuz.interfaces.publishing import PackagePublishingStatus |
2599 | from lp.soyuz.interfaces.sourcepackageformat import ( |
2600 | ISourcePackageFormatSelectionSet, |
2601 | @@ -49,13 +52,13 @@ |
2602 | # - setup/populate parents with packages; |
2603 | # - initialize a child from parents. |
2604 | |
2605 | - def setupDas(self, parent, proc, arch_tag): |
2606 | - pf = getUtility(IProcessorFamilySet).getByName(proc) |
2607 | - if pf.processors.is_empty(): |
2608 | - self.factory.makeProcessor(family=pf) |
2609 | + def setupDas(self, parent, processor_name, arch_tag): |
2610 | + try: |
2611 | + processor = getUtility(IProcessorSet).getByName(processor_name) |
2612 | + except ProcessorNotFound: |
2613 | + processor = self.factory.makeProcessor(name=processor_name) |
2614 | parent_das = self.factory.makeDistroArchSeries( |
2615 | - distroseries=parent, processorfamily=pf, |
2616 | - architecturetag=arch_tag) |
2617 | + distroseries=parent, processor=processor, architecturetag=arch_tag) |
2618 | lf = self.factory.makeLibraryFileAlias() |
2619 | transaction.commit() |
2620 | parent_das.addOrUpdateChroot(lf) |
2621 | @@ -63,10 +66,8 @@ |
2622 | return parent_das |
2623 | |
2624 | def setupParent(self, parent=None, packages=None, format_selection=None, |
2625 | - distribution=None, |
2626 | - pocket=PackagePublishingPocket.RELEASE, |
2627 | - proc='x86', arch_tag='i386' |
2628 | - ): |
2629 | + distribution=None, pocket=PackagePublishingPocket.RELEASE, |
2630 | + proc='386', arch_tag='i386'): |
2631 | if parent is None: |
2632 | parent = self.factory.makeDistroSeries(distribution) |
2633 | parent_das = self.setupDas(parent, proc, arch_tag) |
2634 | |
2635 | === modified file 'lib/lp/soyuz/scripts/tests/test_populatearchive.py' |
2636 | --- lib/lp/soyuz/scripts/tests/test_populatearchive.py 2012-09-27 02:53:00 +0000 |
2637 | +++ lib/lp/soyuz/scripts/tests/test_populatearchive.py 2013-09-26 04:04:44 +0000 |
2638 | @@ -463,7 +463,7 @@ |
2639 | exception_type=SoyuzScriptError, |
2640 | exception_text="Invalid origin archive name: '//'") |
2641 | |
2642 | - def testInvalidProcessorFamilyName(self): |
2643 | + def testInvalidProcessorName(self): |
2644 | """Try copy archive population with an invalid architecture tag. |
2645 | |
2646 | This test should provoke a `SoyuzScriptError` exception. |
2647 | @@ -474,11 +474,11 @@ |
2648 | exception_type=SoyuzScriptError, |
2649 | exception_text="Invalid architecture tag: 'wintel'") |
2650 | |
2651 | - def testFamiliesForExistingArchives(self): |
2652 | - """Try specifying processor family names for existing archive. |
2653 | + def testProcessorsForExistingArchives(self): |
2654 | + """Try specifying processor names for existing archive. |
2655 | |
2656 | - The user is not supposed to specify processor families on the command |
2657 | - line for existing copy archives. The processor families will be read |
2658 | + The user is not supposed to specify processor on the command |
2659 | + line for existing copy archives. The processor will be read |
2660 | from the database instead. Please see also the end of the |
2661 | testMultipleArchTags test. |
2662 | |
2663 | @@ -549,7 +549,7 @@ |
2664 | exception_text=( |
2665 | "error: archive 'hello-1' already exists for 'ubuntu'.")) |
2666 | |
2667 | - def testMissingProcessorFamily(self): |
2668 | + def testMissingProcessor(self): |
2669 | """Try copy archive population without a single architecture tag. |
2670 | |
2671 | This test should provoke a `SoyuzScriptError` exception. |
2672 | |
2673 | === modified file 'lib/lp/soyuz/security.py' |
2674 | --- lib/lp/soyuz/security.py 2011-07-14 21:49:37 +0000 |
2675 | +++ lib/lp/soyuz/security.py 2013-09-26 04:04:44 +0000 |
2676 | @@ -6,21 +6,12 @@ |
2677 | __metaclass__ = type |
2678 | __all__ = [ |
2679 | 'ViewProcessor', |
2680 | - 'ViewProcessorFamily', |
2681 | ] |
2682 | |
2683 | from lp.app.security import AnonymousAuthorization |
2684 | -from lp.soyuz.interfaces.processor import ( |
2685 | - IProcessor, |
2686 | - IProcessorFamily, |
2687 | - ) |
2688 | +from lp.soyuz.interfaces.processor import IProcessor |
2689 | |
2690 | |
2691 | class ViewProcessor(AnonymousAuthorization): |
2692 | """Anyone can view an `IProcessor`.""" |
2693 | usedfor = IProcessor |
2694 | - |
2695 | - |
2696 | -class ViewProcessorFamily(AnonymousAuthorization): |
2697 | - """Anyone can view an `IProcessorFamily`.""" |
2698 | - usedfor = IProcessorFamily |
2699 | |
2700 | === modified file 'lib/lp/soyuz/stories/distroseries/add-architecture.txt' |
2701 | --- lib/lp/soyuz/stories/distroseries/add-architecture.txt 2011-03-16 07:59:26 +0000 |
2702 | +++ lib/lp/soyuz/stories/distroseries/add-architecture.txt 2013-09-26 04:04:44 +0000 |
2703 | @@ -16,11 +16,11 @@ |
2704 | <Link text='Cancel' url='http://launchpad.dev/ubuntu/hoary'> |
2705 | |
2706 | To register a new architecture one has to specify the architecture tag, the |
2707 | -processor family and whether or not that architecture is officially supported |
2708 | +processor and whether or not that architecture is officially supported |
2709 | and/or has PPA support. |
2710 | |
2711 | >>> admin_browser.getControl('Architecture Tag').value = 'ia64' |
2712 | - >>> admin_browser.getControl('Processor Family').value = ['amd64'] |
2713 | + >>> admin_browser.getControl('Processor:').value = ['amd64'] |
2714 | >>> admin_browser.getControl('Official Support').selected = True |
2715 | >>> admin_browser.getControl('PPA support available').selected = True |
2716 | >>> admin_browser.getControl('Continue').click() |
2717 | |
2718 | === modified file 'lib/lp/soyuz/stories/ppa/xx-copy-packages.txt' |
2719 | --- lib/lp/soyuz/stories/ppa/xx-copy-packages.txt 2013-05-03 16:43:19 +0000 |
2720 | +++ lib/lp/soyuz/stories/ppa/xx-copy-packages.txt 2013-09-26 04:04:44 +0000 |
2721 | @@ -112,7 +112,7 @@ |
2722 | >>> login('foo.bar@canonical.com') |
2723 | >>> from lp.services.librarian.interfaces import ILibraryFileAliasSet |
2724 | >>> from lp.registry.interfaces.distribution import IDistributionSet |
2725 | - >>> from lp.soyuz.model.processor import ProcessorFamily |
2726 | + >>> from lp.soyuz.interfaces.processor import IProcessorSet |
2727 | |
2728 | >>> fake_chroot = getUtility(ILibraryFileAliasSet)[1] |
2729 | |
2730 | @@ -128,7 +128,7 @@ |
2731 | >>> cprov = person_set.getByName('cprov') |
2732 | >>> grumpy = ubuntu.getSeries('grumpy') |
2733 | >>> grumpy_i386 = grumpy.newArch( |
2734 | - ... 'i386', ProcessorFamily.get(1), False, cprov, |
2735 | + ... 'i386', getUtility(IProcessorSet).getByName('386'), False, cprov, |
2736 | ... supports_virtualized=True) |
2737 | >>> grumpy.nominatedarchindep = grumpy_i386 |
2738 | >>> trash = grumpy_i386.addOrUpdateChroot(fake_chroot) |
2739 | |
2740 | === modified file 'lib/lp/soyuz/stories/soyuz/xx-distroarchseries.txt' |
2741 | --- lib/lp/soyuz/stories/soyuz/xx-distroarchseries.txt 2013-07-22 17:02:19 +0000 |
2742 | +++ lib/lp/soyuz/stories/soyuz/xx-distroarchseries.txt 2013-09-26 04:04:44 +0000 |
2743 | @@ -28,7 +28,7 @@ |
2744 | This archive contains 5 software packages. |
2745 | Details for Ubuntu Warty i386 |
2746 | Architecture tag: i386 |
2747 | - Processor family: Intel 386 compatible chips |
2748 | + Processor: Intel 386 |
2749 | Port registrant: Mark Shuttleworth |
2750 | 5 binary packages |
2751 | |
2752 | @@ -208,7 +208,7 @@ |
2753 | (unofficial) |
2754 | |
2755 | >>> admin_browser.getControl("Architecture Tag").value = 'i386' |
2756 | - >>> admin_browser.getControl("Processor Family").value = ['x86'] |
2757 | + >>> admin_browser.getControl("Processor:").value = ['386'] |
2758 | >>> admin_browser.getControl("Official Support").selected = True |
2759 | >>> admin_browser.getControl("PPA support available").selected = True |
2760 | |
2761 | @@ -217,7 +217,7 @@ |
2762 | traceback. Although It's not a big problem because this form is very |
2763 | restricted and rarely used. |
2764 | |
2765 | - admin_browser.getControl("Add").click() |
2766 | + admin_browser.getControl("Continue").click() |
2767 | Traceback (most recent call last): |
2768 | ... |
2769 | RetryPsycopgIntegrityError: ERROR: duplicate key violates unique |
2770 | @@ -240,7 +240,7 @@ |
2771 | >>> admin_browser.getLink("Add architecture").click() |
2772 | |
2773 | >>> admin_browser.getControl("Architecture Tag").value = 'amd64' |
2774 | - >>> admin_browser.getControl("Processor Family").value = ['amd64'] |
2775 | + >>> admin_browser.getControl("Processor:").value = ['amd64'] |
2776 | >>> admin_browser.getControl("Official Support").selected = True |
2777 | >>> admin_browser.getControl("PPA support available").selected = True |
2778 | >>> admin_browser.getControl("Continue").click() |
2779 | |
2780 | === modified file 'lib/lp/soyuz/stories/webservice/xx-archive.txt' |
2781 | --- lib/lp/soyuz/stories/webservice/xx-archive.txt 2013-09-16 04:14:56 +0000 |
2782 | +++ lib/lp/soyuz/stories/webservice/xx-archive.txt 2013-09-26 04:04:44 +0000 |
2783 | @@ -44,7 +44,6 @@ |
2784 | description: u'packages to help my friends.' |
2785 | displayname: u'PPA for Celso Providelo' |
2786 | distribution_link: u'http://.../ubuntu' |
2787 | - enabled_restricted_families_collection_link: u'http://.../~cprov/+archive/ppa/enabled_restricted_families' |
2788 | enabled_restricted_processors_collection_link: u'http://.../~cprov/+archive/ppa/enabled_restricted_processors' |
2789 | external_dependencies: None |
2790 | name: u'ppa' |
2791 | |
2792 | === modified file 'lib/lp/soyuz/stories/webservice/xx-distroarchseries.txt' |
2793 | --- lib/lp/soyuz/stories/webservice/xx-distroarchseries.txt 2013-05-01 21:32:12 +0000 |
2794 | +++ lib/lp/soyuz/stories/webservice/xx-distroarchseries.txt 2013-09-26 04:04:44 +0000 |
2795 | @@ -45,7 +45,7 @@ |
2796 | resource_type_link: u'http://.../#distro_arch_series' |
2797 | self_link: u'http://.../ubuntu/hoary/i386' |
2798 | supports_virtualized: True |
2799 | - title: u'The Hoary Hedgehog Release for i386 (x86)' |
2800 | + title: u'The Hoary Hedgehog Release for i386 (386)' |
2801 | web_link: u'http://launchpad.../ubuntu/hoary/i386' |
2802 | |
2803 | DistroArchSeries.enabled is published in the API devel version. |
2804 | @@ -67,5 +67,5 @@ |
2805 | resource_type_link: u'http://.../#distro_arch_series' |
2806 | self_link: u'http://.../ubuntu/hoary/i386' |
2807 | supports_virtualized: True |
2808 | - title: u'The Hoary Hedgehog Release for i386 (x86)' |
2809 | + title: u'The Hoary Hedgehog Release for i386 (386)' |
2810 | web_link: u'http://launchpad.../ubuntu/hoary/i386' |
2811 | |
2812 | === modified file 'lib/lp/soyuz/templates/distroarchseries-portlet-details.pt' |
2813 | --- lib/lp/soyuz/templates/distroarchseries-portlet-details.pt 2012-07-06 06:02:33 +0000 |
2814 | +++ lib/lp/soyuz/templates/distroarchseries-portlet-details.pt 2013-09-26 04:04:44 +0000 |
2815 | @@ -13,8 +13,8 @@ |
2816 | ARCHTAG |
2817 | </a><br /> |
2818 | |
2819 | - <b>Processor family:</b><br /> |
2820 | - <span tal:replace="context/processorfamily/title" /><br /> |
2821 | + <b>Processor:</b><br /> |
2822 | + <span tal:replace="context/processor/title" /><br /> |
2823 | |
2824 | <b>Port registrant:</b><br /> |
2825 | <a tal:replace="structure context/owner/fmt:link" /><br /> |
2826 | |
2827 | === modified file 'lib/lp/soyuz/tests/test_archive.py' |
2828 | --- lib/lp/soyuz/tests/test_archive.py 2013-09-25 08:41:32 +0000 |
2829 | +++ lib/lp/soyuz/tests/test_archive.py 2013-09-26 04:04:44 +0000 |
2830 | @@ -72,7 +72,7 @@ |
2831 | from lp.soyuz.interfaces.binarypackagename import IBinaryPackageNameSet |
2832 | from lp.soyuz.interfaces.component import IComponentSet |
2833 | from lp.soyuz.interfaces.packagecopyjob import IPlainPackageCopyJobSource |
2834 | -from lp.soyuz.interfaces.processor import IProcessorFamilySet |
2835 | +from lp.soyuz.interfaces.processor import IProcessorSet |
2836 | from lp.soyuz.model.archive import ( |
2837 | Archive, |
2838 | validate_ppa, |
2839 | @@ -994,7 +994,7 @@ |
2840 | |
2841 | |
2842 | class TestEnabledRestrictedBuilds(TestCaseWithFactory): |
2843 | - """Ensure that restricted architecture family builds can be allowed and |
2844 | + """Ensure that restricted architectures builds can be allowed and |
2845 | disallowed correctly.""" |
2846 | |
2847 | layer = LaunchpadZopelessLayer |
2848 | @@ -1011,14 +1011,14 @@ |
2849 | |
2850 | def test_default(self): |
2851 | """By default, ARM builds are not allowed as ARM is restricted.""" |
2852 | - self.assertEqual( |
2853 | - 0, |
2854 | - self.archive_arch_set.getByArchive(self.archive, self.arm).count()) |
2855 | - self.assertContentEqual([], self.archive.enabled_restricted_families) |
2856 | + self.assertEqual(0, |
2857 | + self.archive_arch_set.getByArchive( |
2858 | + self.archive, self.arm).count()) |
2859 | + self.assertContentEqual([], self.archive.enabled_restricted_processors) |
2860 | |
2861 | def test_get_uses_archivearch(self): |
2862 | """Adding an entry to ArchiveArch for ARM and an archive will |
2863 | - enable enabled_restricted_families for arm for that archive.""" |
2864 | + enable enabled_restricted_processors for arm for that archive.""" |
2865 | self.assertContentEqual([], self.archive.enabled_restricted_processors) |
2866 | self.archive_arch_set.new(self.archive, self.arm) |
2867 | self.assertEqual( |
2868 | @@ -1027,26 +1027,28 @@ |
2869 | |
2870 | def test_get_returns_restricted_only(self): |
2871 | """Adding an entry to ArchiveArch for something that is not |
2872 | - restricted does not make it show up in enabled_restricted_families. |
2873 | + restricted does not make it show up in enabled_restricted_processors. |
2874 | """ |
2875 | - self.assertContentEqual([], self.archive.enabled_restricted_families) |
2876 | - self.archive_arch_set.new(self.archive, |
2877 | - getUtility(IProcessorFamilySet).getByName('amd64')) |
2878 | - self.assertContentEqual([], self.archive.enabled_restricted_families) |
2879 | + self.assertContentEqual([], self.archive.enabled_restricted_processors) |
2880 | + self.archive_arch_set.new( |
2881 | + self.archive, getUtility(IProcessorSet).getByName('amd64')) |
2882 | + self.assertContentEqual([], self.archive.enabled_restricted_processors) |
2883 | |
2884 | def test_set(self): |
2885 | """The property remembers its value correctly and sets ArchiveArch.""" |
2886 | - arm_proc = self.arm.processors[0] |
2887 | - self.archive.enabled_restricted_families = [self.arm] |
2888 | + self.archive.enabled_restricted_processors = [self.arm] |
2889 | allowed_restricted_processors = self.archive_arch_set.getByArchive( |
2890 | - self.archive, arm_proc) |
2891 | + self.archive, self.arm) |
2892 | self.assertEqual(1, allowed_restricted_processors.count()) |
2893 | - self.assertEqual(arm_proc, allowed_restricted_processors[0].processor) |
2894 | - self.archive.enabled_restricted_families = [] |
2895 | + self.assertEqual( |
2896 | + self.arm, allowed_restricted_processors[0].processor) |
2897 | + self.assertEqual( |
2898 | + [self.arm], self.archive.enabled_restricted_processors) |
2899 | + self.archive.enabled_restricted_processors = [] |
2900 | self.assertEqual( |
2901 | 0, |
2902 | - self.archive_arch_set.getByArchive(self.archive, arm_proc).count()) |
2903 | - self.assertContentEqual([], self.archive.enabled_restricted_families) |
2904 | + self.archive_arch_set.getByArchive(self.archive, self.arm).count()) |
2905 | + self.assertContentEqual([], self.archive.enabled_restricted_processors) |
2906 | |
2907 | |
2908 | class TestBuilddSecret(TestCaseWithFactory): |
2909 | |
2910 | === modified file 'lib/lp/soyuz/tests/test_archivearch.py' |
2911 | --- lib/lp/soyuz/tests/test_archivearch.py 2013-09-25 06:54:24 +0000 |
2912 | +++ lib/lp/soyuz/tests/test_archivearch.py 2013-09-26 04:04:44 +0000 |
2913 | @@ -8,7 +8,6 @@ |
2914 | from lp.registry.interfaces.distribution import IDistributionSet |
2915 | from lp.registry.interfaces.person import IPersonSet |
2916 | from lp.soyuz.interfaces.archivearch import IArchiveArchSet |
2917 | -from lp.soyuz.interfaces.processor import IProcessorFamilySet |
2918 | from lp.testing import TestCaseWithFactory |
2919 | from lp.testing.layers import LaunchpadZopelessLayer |
2920 | |
2921 | @@ -25,48 +24,39 @@ |
2922 | self.ppa = getUtility(IPersonSet).getByName('cprov').archive |
2923 | ubuntu = getUtility(IDistributionSet)['ubuntu'] |
2924 | self.ubuntu_archive = ubuntu.main_archive |
2925 | - pss = getUtility(IProcessorFamilySet) |
2926 | - self.cell_proc = pss.new( |
2927 | + self.cell_proc = self.factory.makeProcessor( |
2928 | 'cell-proc', 'PS cell processor', 'Screamingly faaaaaaaaaaaast', |
2929 | True) |
2930 | - self.cell_proc.addProcessor('Cell', '', '') |
2931 | - self.omap = pss.new( |
2932 | + self.omap = self.factory.makeProcessor( |
2933 | 'omap', 'Multimedia applications processor', |
2934 | 'Does all your sound & video', True) |
2935 | - self.omap.addProcessor('Omap', '', '') |
2936 | |
2937 | - def test_getRestrictedFamilies_no_restricted_associations(self): |
2938 | - # Our archive is not associated with any restricted processor |
2939 | - # families yet. |
2940 | + def test_getRestrictedProcessors_no_restricted_associations(self): |
2941 | + # Our archive is not associated with any restricted processors yet. |
2942 | result_set = list( |
2943 | - self.archive_arch_set.getRestrictedFamilies(self.ppa)) |
2944 | + self.archive_arch_set.getRestrictedProcessors(self.ppa)) |
2945 | archivearches = [row[1] for row in result_set] |
2946 | self.assertTrue(all(aa is None for aa in archivearches)) |
2947 | |
2948 | - def test_getRestrictedFamilies_single_restricted_association(self): |
2949 | - # Our archive is now associated with one of the restricted processor |
2950 | - # families. |
2951 | + def test_getRestrictedProcessors_single_restricted_association(self): |
2952 | + # Our archive is now associated with one of the restricted processors. |
2953 | self.archive_arch_set.new(self.ppa, self.cell_proc) |
2954 | result_set = list( |
2955 | - self.archive_arch_set.getRestrictedFamilies(self.ppa)) |
2956 | + self.archive_arch_set.getRestrictedProcessors(self.ppa)) |
2957 | results = dict( |
2958 | (row[0].name, row[1] is not None) for row in result_set) |
2959 | - self.assertEqual( |
2960 | - {'arm': False, 'cell-proc': True, 'omap': False}, |
2961 | - results) |
2962 | + self.assertEqual({'cell-proc': True, 'omap': False}, results) |
2963 | |
2964 | - def test_getRestrictedFamilies_archive_only(self): |
2965 | + def test_getRestrictedProcessors_archive_only(self): |
2966 | # Test that only the associated archs for the archive itself are |
2967 | # returned. |
2968 | self.archive_arch_set.new(self.ppa, self.cell_proc) |
2969 | self.archive_arch_set.new(self.ubuntu_archive, self.omap) |
2970 | result_set = list( |
2971 | - self.archive_arch_set.getRestrictedFamilies(self.ppa)) |
2972 | + self.archive_arch_set.getRestrictedProcessors(self.ppa)) |
2973 | results = dict( |
2974 | (row[0].name, row[1] is not None) for row in result_set) |
2975 | - self.assertEqual( |
2976 | - {'arm': False, 'cell-proc': True, 'omap': False}, |
2977 | - results) |
2978 | + self.assertEqual({'cell-proc': True, 'omap': False}, results) |
2979 | |
2980 | def test_getByArchive_no_other_archives(self): |
2981 | # Test ArchiveArchSet.getByArchive returns no other archives. |
2982 | |
2983 | === modified file 'lib/lp/soyuz/tests/test_binarypackagebuild.py' |
2984 | --- lib/lp/soyuz/tests/test_binarypackagebuild.py 2013-08-29 18:34:59 +0000 |
2985 | +++ lib/lp/soyuz/tests/test_binarypackagebuild.py 2013-09-26 04:04:44 +0000 |
2986 | @@ -33,7 +33,6 @@ |
2987 | from lp.soyuz.interfaces.component import IComponentSet |
2988 | from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
2989 | from lp.soyuz.model.buildpackagejob import BuildPackageJob |
2990 | -from lp.soyuz.model.processor import ProcessorFamilySet |
2991 | from lp.soyuz.tests.test_publishing import SoyuzTestPublisher |
2992 | from lp.testing import ( |
2993 | api_url, |
2994 | @@ -420,13 +419,7 @@ |
2995 | self.build_set = getUtility(IBinaryPackageBuildSet) |
2996 | |
2997 | # Create a 386 builder |
2998 | - owner = self.factory.makePerson() |
2999 | - processor_family = ProcessorFamilySet().getByProcessorName('386') |
3000 | - processor = processor_family.processors[0] |
3001 | - |
3002 | - self.builder = self.factory.makeBuilder( |
3003 | - processor, 'http://example.com', 'Newbob', 'New Bob the Builder', |
3004 | - owner=owner) |
3005 | + self.builder = self.factory.makeBuilder() |
3006 | |
3007 | # Ensure that our builds were all built by the test builder. |
3008 | for build in self.builds: |
3009 | |
3010 | === modified file 'lib/lp/soyuz/tests/test_build.py' |
3011 | --- lib/lp/soyuz/tests/test_build.py 2013-03-28 08:06:22 +0000 |
3012 | +++ lib/lp/soyuz/tests/test_build.py 2013-09-26 04:04:44 +0000 |
3013 | @@ -42,18 +42,17 @@ |
3014 | def setUp(self): |
3015 | super(TestBuild, self).setUp() |
3016 | self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL) |
3017 | - self.pf = self.factory.makeProcessorFamily() |
3018 | - pf_proc = self.pf.addProcessor(self.factory.getUniqueString(), '', '') |
3019 | + self.processor = self.factory.makeProcessor() |
3020 | self.distroseries = self.factory.makeDistroSeries() |
3021 | self.das = self.factory.makeDistroArchSeries( |
3022 | - distroseries=self.distroseries, processorfamily=self.pf, |
3023 | + distroseries=self.distroseries, processor=self.processor, |
3024 | supports_virtualized=True) |
3025 | with person_logged_in(self.admin): |
3026 | self.publisher = SoyuzTestPublisher() |
3027 | self.publisher.prepareBreezyAutotest() |
3028 | self.distroseries.nominatedarchindep = self.das |
3029 | self.publisher.addFakeChroots(distroseries=self.distroseries) |
3030 | - self.builder = self.factory.makeBuilder(processor=pf_proc) |
3031 | + self.builder = self.factory.makeBuilder(processor=self.processor) |
3032 | self.now = datetime.now(pytz.UTC) |
3033 | |
3034 | def test_title(self): |
3035 | @@ -162,7 +161,7 @@ |
3036 | # Builds can not be retried for released distroseries |
3037 | distroseries = self.factory.makeDistroSeries() |
3038 | das = self.factory.makeDistroArchSeries( |
3039 | - distroseries=distroseries, processorfamily=self.pf, |
3040 | + distroseries=distroseries, processor=self.processor, |
3041 | supports_virtualized=True) |
3042 | with person_logged_in(self.admin): |
3043 | distroseries.nominatedarchindep = das |
3044 | @@ -180,7 +179,7 @@ |
3045 | # released. |
3046 | distroseries = self.factory.makeDistroSeries() |
3047 | das = self.factory.makeDistroArchSeries( |
3048 | - distroseries=distroseries, processorfamily=self.pf, |
3049 | + distroseries=distroseries, processor=self.processor, |
3050 | supports_virtualized=True) |
3051 | archive = self.factory.makeArchive( |
3052 | purpose=ArchivePurpose.PARTNER, |
3053 | |
3054 | === modified file 'lib/lp/soyuz/tests/test_build_depwait.py' |
3055 | --- lib/lp/soyuz/tests/test_build_depwait.py 2013-01-22 02:06:59 +0000 |
3056 | +++ lib/lp/soyuz/tests/test_build_depwait.py 2013-09-26 04:04:44 +0000 |
3057 | @@ -31,11 +31,10 @@ |
3058 | self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL) |
3059 | # Create everything we need to create builds, such as a |
3060 | # DistroArchSeries and a builder. |
3061 | - self.pf = self.factory.makeProcessorFamily() |
3062 | - pf_proc = self.pf.addProcessor(self.factory.getUniqueString(), '', '') |
3063 | + self.processor = self.factory.makeProcessor() |
3064 | self.distroseries = self.factory.makeDistroSeries() |
3065 | self.das = self.factory.makeDistroArchSeries( |
3066 | - distroseries=self.distroseries, processorfamily=self.pf, |
3067 | + distroseries=self.distroseries, processor=self.processor, |
3068 | supports_virtualized=True) |
3069 | self.archive = self.factory.makeArchive( |
3070 | distribution=self.distroseries.distribution, |
3071 | @@ -45,7 +44,7 @@ |
3072 | self.publisher.prepareBreezyAutotest() |
3073 | self.distroseries.nominatedarchindep = self.das |
3074 | self.publisher.addFakeChroots(distroseries=self.distroseries) |
3075 | - self.builder = self.factory.makeBuilder(processor=pf_proc) |
3076 | + self.builder = self.factory.makeBuilder(processor=self.processor) |
3077 | |
3078 | def test_update_dependancies(self): |
3079 | # Calling .updateDependencies() on a build will remove those which |
3080 | |
3081 | === modified file 'lib/lp/soyuz/tests/test_build_notify.py' |
3082 | --- lib/lp/soyuz/tests/test_build_notify.py 2013-01-24 05:50:23 +0000 |
3083 | +++ lib/lp/soyuz/tests/test_build_notify.py 2013-09-26 04:04:44 +0000 |
3084 | @@ -35,11 +35,10 @@ |
3085 | super(TestBuildNotify, self).setUp() |
3086 | self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL) |
3087 | # Create all of the items we need to create builds |
3088 | - self.pf = self.factory.makeProcessorFamily() |
3089 | - pf_proc = self.pf.addProcessor(self.factory.getUniqueString(), '', '') |
3090 | + self.processor = self.factory.makeProcessor() |
3091 | self.distroseries = self.factory.makeDistroSeries() |
3092 | self.das = self.factory.makeDistroArchSeries( |
3093 | - distroseries=self.distroseries, processorfamily=self.pf, |
3094 | + distroseries=self.distroseries, processor=self.processor, |
3095 | supports_virtualized=True) |
3096 | self.creator = self.factory.makePerson(email='test@example.com') |
3097 | self.gpgkey = self.factory.makeGPGKey(owner=self.creator) |
3098 | @@ -55,7 +54,7 @@ |
3099 | self.publisher.prepareBreezyAutotest() |
3100 | self.distroseries.nominatedarchindep = self.das |
3101 | self.publisher.addFakeChroots(distroseries=self.distroseries) |
3102 | - self.builder = self.factory.makeBuilder(processor=pf_proc) |
3103 | + self.builder = self.factory.makeBuilder(processor=self.processor) |
3104 | for member in buildd_admins.activemembers: |
3105 | self.buildd_admins_email.append(member.preferredemail.email) |
3106 | self.builds = [] |
3107 | |
3108 | === modified file 'lib/lp/soyuz/tests/test_build_privacy.py' |
3109 | --- lib/lp/soyuz/tests/test_build_privacy.py 2012-01-01 02:58:52 +0000 |
3110 | +++ lib/lp/soyuz/tests/test_build_privacy.py 2013-09-26 04:04:44 +0000 |
3111 | @@ -25,18 +25,17 @@ |
3112 | super(TestBuildPrivacy, self).setUp() |
3113 | # Add everything we need to create builds. |
3114 | self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL) |
3115 | - pf = self.factory.makeProcessorFamily() |
3116 | - pf_proc = pf.addProcessor(self.factory.getUniqueString(), '', '') |
3117 | + processor = self.factory.makeProcessor() |
3118 | distroseries = self.factory.makeDistroSeries() |
3119 | das = self.factory.makeDistroArchSeries( |
3120 | - distroseries=distroseries, processorfamily=pf, |
3121 | + distroseries=distroseries, processor=processor, |
3122 | supports_virtualized=True) |
3123 | with person_logged_in(self.admin): |
3124 | publisher = SoyuzTestPublisher() |
3125 | publisher.prepareBreezyAutotest() |
3126 | distroseries.nominatedarchindep = das |
3127 | publisher.addFakeChroots(distroseries=distroseries) |
3128 | - self.factory.makeBuilder(processor=pf_proc) |
3129 | + self.factory.makeBuilder(processor=processor) |
3130 | self.public_archive = self.factory.makeArchive() |
3131 | self.private_archive = self.factory.makeArchive(private=True) |
3132 | # Create one public and one private build. |
3133 | |
3134 | === modified file 'lib/lp/soyuz/tests/test_build_set.py' |
3135 | --- lib/lp/soyuz/tests/test_build_set.py 2013-02-06 10:44:24 +0000 |
3136 | +++ lib/lp/soyuz/tests/test_build_set.py 2013-09-26 04:04:44 +0000 |
3137 | @@ -3,7 +3,6 @@ |
3138 | |
3139 | __metaclass__ = type |
3140 | |
3141 | -from storm.store import EmptyResultSet |
3142 | from zope.component import getUtility |
3143 | from zope.security.proxy import removeSecurityProxy |
3144 | |
3145 | @@ -31,19 +30,15 @@ |
3146 | def setUp(self): |
3147 | super(TestBuildSet, self).setUp() |
3148 | self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL) |
3149 | - self.pf_one = self.factory.makeProcessorFamily() |
3150 | - pf_proc_1 = self.pf_one.addProcessor( |
3151 | - self.factory.getUniqueString(), '', '') |
3152 | - self.pf_two = self.factory.makeProcessorFamily() |
3153 | - pf_proc_2 = self.pf_two.addProcessor( |
3154 | - self.factory.getUniqueString(), '', '') |
3155 | + self.processor_one = self.factory.makeProcessor() |
3156 | + self.processor_two = self.factory.makeProcessor() |
3157 | self.distroseries = self.factory.makeDistroSeries() |
3158 | self.distribution = self.distroseries.distribution |
3159 | self.das_one = self.factory.makeDistroArchSeries( |
3160 | - distroseries=self.distroseries, processorfamily=self.pf_one, |
3161 | + distroseries=self.distroseries, processor=self.processor_one, |
3162 | supports_virtualized=True) |
3163 | self.das_two = self.factory.makeDistroArchSeries( |
3164 | - distroseries=self.distroseries, processorfamily=self.pf_two, |
3165 | + distroseries=self.distroseries, processor=self.processor_two, |
3166 | supports_virtualized=True) |
3167 | self.archive = self.factory.makeArchive( |
3168 | distribution=self.distroseries.distribution, |
3169 | @@ -53,8 +48,10 @@ |
3170 | self.publisher.prepareBreezyAutotest() |
3171 | self.distroseries.nominatedarchindep = self.das_one |
3172 | self.publisher.addFakeChroots(distroseries=self.distroseries) |
3173 | - self.builder_one = self.factory.makeBuilder(processor=pf_proc_1) |
3174 | - self.builder_two = self.factory.makeBuilder(processor=pf_proc_2) |
3175 | + self.builder_one = self.factory.makeBuilder( |
3176 | + processor=self.processor_one) |
3177 | + self.builder_two = self.factory.makeBuilder( |
3178 | + processor=self.processor_two) |
3179 | self.builds = [] |
3180 | self.spphs = [] |
3181 | |
3182 | |
3183 | === modified file 'lib/lp/soyuz/tests/test_build_start_estimation.py' |
3184 | --- lib/lp/soyuz/tests/test_build_start_estimation.py 2013-09-12 02:29:55 +0000 |
3185 | +++ lib/lp/soyuz/tests/test_build_start_estimation.py 2013-09-26 04:04:44 +0000 |
3186 | @@ -41,8 +41,7 @@ |
3187 | self.distroseries = self.factory.makeDistroSeries() |
3188 | self.bob = getUtility(IBuilderSet).getByName(BOB_THE_BUILDER_NAME) |
3189 | das = self.factory.makeDistroArchSeries( |
3190 | - distroseries=self.distroseries, |
3191 | - processorfamily=self.bob.processor.family, |
3192 | + distroseries=self.distroseries, processor=self.bob.processor, |
3193 | architecturetag='i386', supports_virtualized=True) |
3194 | with person_logged_in(self.admin): |
3195 | self.distroseries.nominatedarchindep = das |
3196 | |
3197 | === modified file 'lib/lp/soyuz/tests/test_buildpackagejob.py' |
3198 | --- lib/lp/soyuz/tests/test_buildpackagejob.py 2013-09-02 04:46:27 +0000 |
3199 | +++ lib/lp/soyuz/tests/test_buildpackagejob.py 2013-09-26 04:04:44 +0000 |
3200 | @@ -32,9 +32,9 @@ |
3201 | SCORE_BY_POCKET, |
3202 | SCORE_BY_URGENCY, |
3203 | ) |
3204 | +from lp.soyuz.interfaces.processor import IProcessorSet |
3205 | from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
3206 | from lp.soyuz.model.buildpackagejob import BuildPackageJob |
3207 | -from lp.soyuz.model.processor import ProcessorFamilySet |
3208 | from lp.soyuz.tests.test_publishing import SoyuzTestPublisher |
3209 | from lp.testing import ( |
3210 | anonymous_logged_in, |
3211 | @@ -93,12 +93,11 @@ |
3212 | self.i8 = self.factory.makeBuilder(name='i386-n-8', virtualized=False) |
3213 | self.i9 = self.factory.makeBuilder(name='i386-n-9', virtualized=False) |
3214 | |
3215 | - processor_fam = ProcessorFamilySet().getByName('hppa') |
3216 | - proc = processor_fam.processors[0] |
3217 | + processor = getUtility(IProcessorSet).getByName('hppa') |
3218 | self.h6 = self.factory.makeBuilder( |
3219 | - name='hppa-n-6', processor=proc, virtualized=False) |
3220 | + name='hppa-n-6', processor=processor, virtualized=False) |
3221 | self.h7 = self.factory.makeBuilder( |
3222 | - name='hppa-n-7', processor=proc, virtualized=False) |
3223 | + name='hppa-n-7', processor=processor, virtualized=False) |
3224 | |
3225 | self.builders = dict() |
3226 | # x86 native |
3227 | |
3228 | === modified file 'lib/lp/soyuz/tests/test_hasbuildrecords.py' |
3229 | --- lib/lp/soyuz/tests/test_hasbuildrecords.py 2013-06-20 05:50:00 +0000 |
3230 | +++ lib/lp/soyuz/tests/test_hasbuildrecords.py 2013-09-26 04:04:44 +0000 |
3231 | @@ -24,7 +24,6 @@ |
3232 | IHasBuildRecords, |
3233 | IncompatibleArguments, |
3234 | ) |
3235 | -from lp.soyuz.model.processor import ProcessorFamilySet |
3236 | from lp.soyuz.model.publishing import SourcePackagePublishingHistory |
3237 | from lp.soyuz.tests.test_binarypackagebuild import BaseTestCaseWithThreeBuilds |
3238 | from lp.soyuz.tests.test_publishing import SoyuzTestPublisher |
3239 | @@ -80,19 +79,15 @@ |
3240 | self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL) |
3241 | # Create the machinery we need to create builds, such as |
3242 | # DistroArchSeries and builders. |
3243 | - self.pf_one = self.factory.makeProcessorFamily() |
3244 | - pf_proc_1 = self.pf_one.addProcessor( |
3245 | - self.factory.getUniqueString(), '', '') |
3246 | - self.pf_two = self.factory.makeProcessorFamily() |
3247 | - pf_proc_2 = self.pf_two.addProcessor( |
3248 | - self.factory.getUniqueString(), '', '') |
3249 | + self.processor_one = self.factory.makeProcessor() |
3250 | + self.processor_two = self.factory.makeProcessor() |
3251 | self.distroseries = self.factory.makeDistroSeries() |
3252 | self.distribution = self.distroseries.distribution |
3253 | self.das_one = self.factory.makeDistroArchSeries( |
3254 | - distroseries=self.distroseries, processorfamily=self.pf_one, |
3255 | + distroseries=self.distroseries, processor=self.processor_one, |
3256 | supports_virtualized=True) |
3257 | self.das_two = self.factory.makeDistroArchSeries( |
3258 | - distroseries=self.distroseries, processorfamily=self.pf_two, |
3259 | + distroseries=self.distroseries, processor=self.processor_two, |
3260 | supports_virtualized=True) |
3261 | self.archive = self.factory.makeArchive( |
3262 | distribution=self.distroseries.distribution, |
3263 | @@ -103,8 +98,10 @@ |
3264 | self.publisher.prepareBreezyAutotest() |
3265 | self.distroseries.nominatedarchindep = self.das_one |
3266 | self.publisher.addFakeChroots(distroseries=self.distroseries) |
3267 | - self.builder_one = self.factory.makeBuilder(processor=pf_proc_1) |
3268 | - self.builder_two = self.factory.makeBuilder(processor=pf_proc_2) |
3269 | + self.builder_one = self.factory.makeBuilder( |
3270 | + processor=self.processor_one) |
3271 | + self.builder_two = self.factory.makeBuilder( |
3272 | + processor=self.processor_two) |
3273 | self.builds = [] |
3274 | self.createBuilds() |
3275 | |
3276 | @@ -202,12 +199,7 @@ |
3277 | super(TestBuilderHasBuildRecords, self).setUp() |
3278 | |
3279 | # Create a 386 builder |
3280 | - owner = self.factory.makePerson() |
3281 | - processor_family = ProcessorFamilySet().getByProcessorName('386') |
3282 | - processor = processor_family.processors[0] |
3283 | - self.context = self.factory.makeBuilder( |
3284 | - processor, 'http://example.com', 'Newbob', 'New Bob the Builder', |
3285 | - owner=owner) |
3286 | + self.context = self.factory.makeBuilder() |
3287 | |
3288 | # Ensure that our builds were all built by the test builder. |
3289 | for build in self.builds: |
3290 | @@ -313,18 +305,17 @@ |
3291 | # Set up a distroseries and related bits, so we can create builds. |
3292 | source_name = self.factory.getUniqueString() |
3293 | spn = self.factory.makeSourcePackageName(name=source_name) |
3294 | - pf = self.factory.makeProcessorFamily() |
3295 | - pf_proc = pf.addProcessor(self.factory.getUniqueString(), '', '') |
3296 | + processor = self.factory.makeProcessor() |
3297 | distroseries = self.factory.makeDistroSeries() |
3298 | das = self.factory.makeDistroArchSeries( |
3299 | - distroseries=distroseries, processorfamily=pf, |
3300 | + distroseries=distroseries, processor=processor, |
3301 | supports_virtualized=True) |
3302 | with person_logged_in(admin): |
3303 | publisher = SoyuzTestPublisher() |
3304 | publisher.prepareBreezyAutotest() |
3305 | publisher.addFakeChroots(distroseries=distroseries) |
3306 | distroseries.nominatedarchindep = das |
3307 | - self.factory.makeBuilder(processor=pf_proc) |
3308 | + self.factory.makeBuilder(processor=processor) |
3309 | spph = self.factory.makeSourcePackagePublishingHistory( |
3310 | sourcepackagename=spn, distroseries=distroseries) |
3311 | spph.createMissingBuilds() |
3312 | |
3313 | === modified file 'lib/lp/soyuz/tests/test_initializedistroseriesjob.py' |
3314 | --- lib/lp/soyuz/tests/test_initializedistroseriesjob.py 2013-09-12 02:29:55 +0000 |
3315 | +++ lib/lp/soyuz/tests/test_initializedistroseriesjob.py 2013-09-26 04:04:44 +0000 |
3316 | @@ -20,7 +20,10 @@ |
3317 | InitializationPending, |
3318 | ) |
3319 | from lp.soyuz.interfaces.packageset import IPackagesetSet |
3320 | -from lp.soyuz.interfaces.processor import IProcessorFamilySet |
3321 | +from lp.soyuz.interfaces.processor import ( |
3322 | + IProcessorSet, |
3323 | + ProcessorNotFound, |
3324 | + ) |
3325 | from lp.soyuz.interfaces.publishing import PackagePublishingStatus |
3326 | from lp.soyuz.interfaces.sourcepackageformat import ( |
3327 | ISourcePackageFormatSelectionSet, |
3328 | @@ -229,11 +232,10 @@ |
3329 | |
3330 | |
3331 | def create_child(factory): |
3332 | - pf = factory.makeProcessorFamily() |
3333 | - pf.addProcessor('x86', '', '') |
3334 | + processor = factory.makeProcessor() |
3335 | parent = factory.makeDistroSeries() |
3336 | parent_das = factory.makeDistroArchSeries( |
3337 | - distroseries=parent, processorfamily=pf) |
3338 | + distroseries=parent, processor=processor) |
3339 | lf = factory.makeLibraryFileAlias() |
3340 | # Since the LFA needs to be in the librarian, commit. |
3341 | transaction.commit() |
3342 | @@ -272,13 +274,13 @@ |
3343 | def job_source(self): |
3344 | return getUtility(IInitializeDistroSeriesJobSource) |
3345 | |
3346 | - def setupDas(self, parent, proc, arch_tag): |
3347 | - pf = getUtility(IProcessorFamilySet).getByName(proc) |
3348 | - if pf.processors.is_empty(): |
3349 | - self.factory.makeProcessor(family=pf) |
3350 | + def setupDas(self, parent, processor_name, arch_tag): |
3351 | + try: |
3352 | + processor = getUtility(IProcessorSet).getByName(processor_name) |
3353 | + except ProcessorNotFound: |
3354 | + processor = self.factory.makeProcessor(name=processor_name) |
3355 | parent_das = self.factory.makeDistroArchSeries( |
3356 | - distroseries=parent, processorfamily=pf, |
3357 | - architecturetag=arch_tag) |
3358 | + distroseries=parent, processor=processor, architecturetag=arch_tag) |
3359 | lf = self.factory.makeLibraryFileAlias() |
3360 | transaction.commit() |
3361 | parent_das.addOrUpdateChroot(lf) |
3362 | |
3363 | === modified file 'lib/lp/soyuz/tests/test_packagecloner.py' |
3364 | --- lib/lp/soyuz/tests/test_packagecloner.py 2012-04-26 21:23:33 +0000 |
3365 | +++ lib/lp/soyuz/tests/test_packagecloner.py 2013-09-26 04:04:44 +0000 |
3366 | @@ -17,11 +17,11 @@ |
3367 | from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet |
3368 | from lp.soyuz.interfaces.component import IComponentSet |
3369 | from lp.soyuz.interfaces.packagecloner import IPackageCloner |
3370 | +from lp.soyuz.interfaces.processor import IProcessorSet |
3371 | from lp.soyuz.interfaces.publishing import ( |
3372 | active_publishing_status, |
3373 | IPublishingSet, |
3374 | ) |
3375 | -from lp.soyuz.model.processor import ProcessorFamilySet |
3376 | from lp.testing import TestCaseWithFactory |
3377 | from lp.testing.layers import LaunchpadZopelessLayer |
3378 | |
3379 | @@ -78,7 +78,7 @@ |
3380 | distribution=distro, name=distroseries_name) |
3381 | das = self.factory.makeDistroArchSeries( |
3382 | distroseries=distroseries, architecturetag="i386", |
3383 | - processorfamily=ProcessorFamilySet().getByName("x86"), |
3384 | + processor=getUtility(IProcessorSet).getByName('386'), |
3385 | supports_virtualized=True) |
3386 | distroseries.nominatedarchindep = das |
3387 | return distroseries |
3388 | @@ -114,7 +114,7 @@ |
3389 | |
3390 | def makeCopyArchive(self, package_infos, component="main", |
3391 | source_pocket=None, target_pocket=None, |
3392 | - proc_families=None): |
3393 | + processors=None): |
3394 | """Make a copy archive based on a new distribution.""" |
3395 | distroseries = self.createSourceDistribution(package_infos) |
3396 | copy_archive = self.getTargetArchive(distroseries.distribution) |
3397 | @@ -122,7 +122,7 @@ |
3398 | self.copyArchive( |
3399 | copy_archive, distroseries, from_pocket=source_pocket, |
3400 | to_pocket=target_pocket, to_component=to_component, |
3401 | - proc_families=proc_families) |
3402 | + processors=processors) |
3403 | return (copy_archive, distroseries) |
3404 | |
3405 | def checkBuilds(self, archive, package_infos): |
3406 | @@ -145,7 +145,7 @@ |
3407 | |
3408 | def copyArchive(self, to_archive, to_distroseries, from_archive=None, |
3409 | from_distroseries=None, from_pocket=None, to_pocket=None, |
3410 | - to_component=None, packagesets=None, proc_families=None): |
3411 | + to_component=None, packagesets=None, processors=None): |
3412 | """Use a PackageCloner to copy an archive.""" |
3413 | if from_distroseries is None: |
3414 | from_distroseries = to_distroseries |
3415 | @@ -169,7 +169,7 @@ |
3416 | cloner = getUtility(IPackageCloner) |
3417 | cloner.clonePackages( |
3418 | origin, destination, distroarchseries_list=None, |
3419 | - proc_families=proc_families) |
3420 | + processors=processors) |
3421 | return cloner |
3422 | |
3423 | def testCopiesPublished(self): |
3424 | @@ -318,8 +318,8 @@ |
3425 | self.checkCopiedSources( |
3426 | copy_archive, distroseries, [package_info]) |
3427 | |
3428 | - def testCreatesNoBuildsWithNoProcFamilies(self): |
3429 | - """Test that no builds are created if we specify no proc families.""" |
3430 | + def testCreatesNoBuildsWithNoProcessors(self): |
3431 | + """Test that no builds are created if we specify no processors.""" |
3432 | package_info = PackageInfo( |
3433 | "bzr", "2.1", status=PackagePublishingStatus.PUBLISHED) |
3434 | copy_archive, distroseries = self.makeCopyArchive([package_info]) |
3435 | @@ -329,71 +329,71 @@ |
3436 | """Test that a copy archive creates builds for the copied packages.""" |
3437 | package_info = PackageInfo( |
3438 | "bzr", "2.1", status=PackagePublishingStatus.PUBLISHED) |
3439 | - # This is the processor family for the DAS that the source has, |
3440 | - # so we expect to get builds. |
3441 | - proc_families = [ProcessorFamilySet().getByName("x86")] |
3442 | + # This is the processor for the DAS that the source has, so we expect |
3443 | + # to get builds. |
3444 | + processors = [getUtility(IProcessorSet).getByName('386')] |
3445 | copy_archive, distroseries = self.makeCopyArchive( |
3446 | - [package_info], proc_families=proc_families) |
3447 | + [package_info], processors=processors) |
3448 | self.checkBuilds(copy_archive, [package_info]) |
3449 | |
3450 | - def testNoBuildsIfProcFamilyNotInSource(self): |
3451 | - """Test that no builds are created for a proc family without a DAS.""" |
3452 | + def testNoBuildsIfProcessorNotInSource(self): |
3453 | + """Test that no builds are created for a processor without a DAS.""" |
3454 | package_info = PackageInfo( |
3455 | "bzr", "2.1", status=PackagePublishingStatus.PUBLISHED) |
3456 | - # This is a processor family without a DAS in the source, so |
3457 | - # we expect no builds. |
3458 | - family = self.factory.makeProcessorFamily(name="armel") |
3459 | - proc_families = [family] |
3460 | + # This is a processor without a DAS in the source, so we expect no |
3461 | + # builds. |
3462 | + processors = [self.factory.makeProcessor(name="armel")] |
3463 | copy_archive, distroseries = self.makeCopyArchive( |
3464 | - [package_info], proc_families=proc_families) |
3465 | + [package_info], processors=processors) |
3466 | self.checkBuilds(copy_archive, []) |
3467 | |
3468 | - def testBuildsOnlyForProcFamiliesInSource(self): |
3469 | - """Test that builds are only created for proc families in source.""" |
3470 | + def testBuildsOnlyForProcessorsInSource(self): |
3471 | + """Test that builds are only created for processors in source.""" |
3472 | package_info = PackageInfo( |
3473 | "bzr", "2.1", status=PackagePublishingStatus.PUBLISHED) |
3474 | - # One of these processor families has a DAS in the source, so |
3475 | - # we expect one set of builds |
3476 | - family = self.factory.makeProcessorFamily(name="armel") |
3477 | - proc_families = [family, ProcessorFamilySet().getByName("x86")] |
3478 | + # One of these processors has a DAS in the source, so we expect one |
3479 | + # set of builds. |
3480 | + processors = [ |
3481 | + self.factory.makeProcessor(name="armel"), |
3482 | + getUtility(IProcessorSet).getByName('386')] |
3483 | copy_archive, distroseries = self.makeCopyArchive( |
3484 | - [package_info], proc_families=proc_families) |
3485 | + [package_info], processors=processors) |
3486 | self.checkBuilds(copy_archive, [package_info]) |
3487 | |
3488 | def testCreatesSubsetOfBuilds(self): |
3489 | - """Test that builds are only created for requested families.""" |
3490 | + """Test that builds are only created for requested processors.""" |
3491 | package_info = PackageInfo( |
3492 | "bzr", "2.1", status=PackagePublishingStatus.PUBLISHED) |
3493 | distroseries = self.createSourceDistribution([package_info]) |
3494 | - # Create a DAS for a second family |
3495 | + # Create a DAS for a second processor. |
3496 | self.factory.makeDistroArchSeries( |
3497 | distroseries=distroseries, architecturetag="amd64", |
3498 | - processorfamily=ProcessorFamilySet().getByName("amd64"), |
3499 | + processor=getUtility(IProcessorSet).getByName('amd64'), |
3500 | supports_virtualized=True) |
3501 | - # The request builds for only one of the families, so we |
3502 | - # expect just one build for each source |
3503 | - proc_families = [ProcessorFamilySet().getByName("x86")] |
3504 | + # The request builds for only one of the processors, so we |
3505 | + # expect just one build for each source. |
3506 | + processors = [getUtility(IProcessorSet).getByName('386')] |
3507 | copy_archive = self.getTargetArchive(distroseries.distribution) |
3508 | self.copyArchive( |
3509 | - copy_archive, distroseries, proc_families=proc_families) |
3510 | + copy_archive, distroseries, processors=processors) |
3511 | self.checkBuilds(copy_archive, [package_info]) |
3512 | |
3513 | def testCreatesMultipleBuilds(self): |
3514 | - """Test that multiple families result in mutiple builds.""" |
3515 | + """Test that multiple processors result in mutiple builds.""" |
3516 | package_info = PackageInfo( |
3517 | "bzr", "2.1", status=PackagePublishingStatus.PUBLISHED) |
3518 | distroseries = self.createSourceDistribution([package_info]) |
3519 | - # Create a DAS for a second family |
3520 | - amd64_family = ProcessorFamilySet().getByName("amd64") |
3521 | + # Create a DAS for a second processor. |
3522 | + amd64 = getUtility(IProcessorSet).getByName('amd64') |
3523 | self.factory.makeDistroArchSeries( |
3524 | distroseries=distroseries, architecturetag="amd64", |
3525 | - processorfamily=amd64_family, supports_virtualized=True) |
3526 | - # The request builds for both families, so we expect two builds |
3527 | + processor=amd64, supports_virtualized=True) |
3528 | + # The request builds for both processors, so we expect two builds |
3529 | # per source. |
3530 | - proc_families = [ProcessorFamilySet().getByName("x86"), amd64_family] |
3531 | + processors = [getUtility(IProcessorSet).getByName('386'), amd64] |
3532 | copy_archive = self.getTargetArchive(distroseries.distribution) |
3533 | self.copyArchive( |
3534 | - copy_archive, distroseries, proc_families=proc_families) |
3535 | + copy_archive, distroseries, processors=processors) |
3536 | self.checkBuilds(copy_archive, [package_info, package_info]) |
3537 | |
3538 | def diffArchives(self, target_archive, target_distroseries, |
3539 | @@ -590,11 +590,11 @@ |
3540 | self.checkCopiedSources( |
3541 | copy_archive, distroseries, [package_infos[1]] + package_infos2) |
3542 | |
3543 | - def setArchiveArchitectures(self, archive, proc_families): |
3544 | - """Associate the archive with the processor families.""" |
3545 | + def setArchiveArchitectures(self, archive, processors): |
3546 | + """Associate the archive with the processors.""" |
3547 | aa_set = getUtility(IArchiveArchSet) |
3548 | - for proc_family in proc_families: |
3549 | - aa_set.new(archive, proc_family) |
3550 | + for processor in processors: |
3551 | + aa_set.new(archive, processor) |
3552 | |
3553 | def testMergeCopyCreatesBuilds(self): |
3554 | package_infos = [ |
3555 | @@ -603,10 +603,10 @@ |
3556 | PackageInfo( |
3557 | "apt", "1.2", status=PackagePublishingStatus.PUBLISHED), |
3558 | ] |
3559 | - proc_families = [ProcessorFamilySet().getByName("x86")] |
3560 | + processors = [getUtility(IProcessorSet).getByName('386')] |
3561 | copy_archive, distroseries = self.makeCopyArchive( |
3562 | - package_infos, proc_families=proc_families) |
3563 | - self.setArchiveArchitectures(copy_archive, proc_families) |
3564 | + package_infos, processors=processors) |
3565 | + self.setArchiveArchitectures(copy_archive, processors) |
3566 | package_infos2 = [ |
3567 | PackageInfo( |
3568 | "bzr", "2.2", status=PackagePublishingStatus.PUBLISHED), |
3569 | @@ -624,16 +624,16 @@ |
3570 | PackageInfo( |
3571 | "bzr", "2.1", status=PackagePublishingStatus.PUBLISHED), |
3572 | ] |
3573 | - # We specify no processor families at creation time |
3574 | + # We specify no processors at creation time. |
3575 | copy_archive, distroseries = self.makeCopyArchive( |
3576 | - package_infos, proc_families=[]) |
3577 | + package_infos, processors=[]) |
3578 | package_infos2 = [ |
3579 | PackageInfo( |
3580 | "bzr", "2.2", status=PackagePublishingStatus.PUBLISHED), |
3581 | ] |
3582 | self.createSourcePublications(package_infos2, distroseries) |
3583 | self.mergeCopy(copy_archive, distroseries) |
3584 | - # And so we get no builds at merge time |
3585 | + # And so we get no builds at merge time. |
3586 | self.checkBuilds(copy_archive, []) |
3587 | |
3588 | def testMergeCopyCreatesBuildsForMultipleArchitectures(self): |
3589 | @@ -644,18 +644,18 @@ |
3590 | "apt", "1.2", status=PackagePublishingStatus.PUBLISHED), |
3591 | ] |
3592 | distroseries = self.createSourceDistribution(package_infos) |
3593 | - # Create a DAS for a second family |
3594 | - amd64_family = ProcessorFamilySet().getByName("amd64") |
3595 | + # Create a DAS for a second processor. |
3596 | + amd64 = getUtility(IProcessorSet).getByName('amd64') |
3597 | self.factory.makeDistroArchSeries( |
3598 | distroseries=distroseries, architecturetag="amd64", |
3599 | - processorfamily=amd64_family, supports_virtualized=True) |
3600 | - # The request builds for both families, so we expect two builds |
3601 | + processor=amd64, supports_virtualized=True) |
3602 | + # The request builds for both processors, so we expect two builds |
3603 | # per source. |
3604 | - proc_families = [ProcessorFamilySet().getByName("x86"), amd64_family] |
3605 | + processors = [getUtility(IProcessorSet).getByName('386'), amd64] |
3606 | copy_archive = self.getTargetArchive(distroseries.distribution) |
3607 | - self.setArchiveArchitectures(copy_archive, proc_families) |
3608 | + self.setArchiveArchitectures(copy_archive, processors) |
3609 | self.copyArchive( |
3610 | - copy_archive, distroseries, proc_families=proc_families) |
3611 | + copy_archive, distroseries, processors=processors) |
3612 | package_infos2 = [ |
3613 | PackageInfo( |
3614 | "bzr", "2.2", status=PackagePublishingStatus.PUBLISHED), |
3615 | |
3616 | === modified file 'lib/lp/soyuz/tests/test_processor.py' |
3617 | --- lib/lp/soyuz/tests/test_processor.py 2013-06-20 05:50:00 +0000 |
3618 | +++ lib/lp/soyuz/tests/test_processor.py 2013-09-26 04:04:44 +0000 |
3619 | @@ -1,15 +1,13 @@ |
3620 | # Copyright 2010 Canonical Ltd. This software is licensed under the |
3621 | # GNU Affero General Public License version 3 (see the file LICENSE). |
3622 | |
3623 | -"""Test Processor and ProcessorFamily features.""" |
3624 | +"""Test Processor features.""" |
3625 | |
3626 | from zope.component import getUtility |
3627 | |
3628 | from lp.services.database.interfaces import IStore |
3629 | from lp.soyuz.interfaces.processor import ( |
3630 | IProcessor, |
3631 | - IProcessorFamily, |
3632 | - IProcessorFamilySet, |
3633 | IProcessorSet, |
3634 | ProcessorNotFound, |
3635 | ) |
3636 | @@ -19,53 +17,17 @@ |
3637 | logout, |
3638 | TestCaseWithFactory, |
3639 | ) |
3640 | -from lp.testing.layers import ( |
3641 | - DatabaseFunctionalLayer, |
3642 | - LaunchpadZopelessLayer, |
3643 | - ) |
3644 | +from lp.testing.layers import DatabaseFunctionalLayer |
3645 | from lp.testing.pages import LaunchpadWebServiceCaller |
3646 | |
3647 | |
3648 | -class ProcessorFamilyTests(TestCaseWithFactory): |
3649 | - """Test ProcessorFamily.""" |
3650 | - |
3651 | - layer = LaunchpadZopelessLayer |
3652 | - |
3653 | - def test_create(self): |
3654 | - """Test adding a new ProcessorFamily.""" |
3655 | - family = getUtility(IProcessorFamilySet).new("avr", "Atmel AVR", |
3656 | - "The Modified Harvard architecture 8-bit RISC processors.") |
3657 | - self.assertProvides(family, IProcessorFamily) |
3658 | - |
3659 | - def test_add_processor(self): |
3660 | - """Test adding a new Processor to a ProcessorFamily.""" |
3661 | - family = getUtility(IProcessorFamilySet).new("avr", "Atmel AVR", |
3662 | - "The Modified Harvard architecture 8-bit RISC processors.") |
3663 | - proc = family.addProcessor( |
3664 | - "avr2001", "The 2001 AVR", "Fast as light.") |
3665 | - self.assertProvides(proc, IProcessor) |
3666 | - self.assertEquals(family, proc.family) |
3667 | - |
3668 | - def test_get_restricted(self): |
3669 | - """Test retrieving all restricted processors.""" |
3670 | - family_set = getUtility(IProcessorFamilySet) |
3671 | - normal_family = getUtility(IProcessorFamilySet).new( |
3672 | - "avr", "Atmel AVR", |
3673 | - "The Modified Harvard architecture 8-bit RISC processors.") |
3674 | - restricted_family = getUtility(IProcessorFamilySet).new( |
3675 | - "5051", "5051", "Another small processor family", |
3676 | - restricted=True) |
3677 | - self.assertFalse(normal_family in family_set.getRestricted()) |
3678 | - self.assertTrue(restricted_family in family_set.getRestricted()) |
3679 | - |
3680 | - |
3681 | class ProcessorSetTests(TestCaseWithFactory): |
3682 | layer = DatabaseFunctionalLayer |
3683 | |
3684 | def test_getByName(self): |
3685 | processor_set = getUtility(IProcessorSet) |
3686 | - q1 = self.factory.makeProcessorFamily(name='q1') |
3687 | - self.assertEquals(q1.processors[0], processor_set.getByName('q1')) |
3688 | + q1 = self.factory.makeProcessor(name='q1') |
3689 | + self.assertEquals(q1, processor_set.getByName('q1')) |
3690 | |
3691 | def test_getByName_not_found(self): |
3692 | processor_set = getUtility(IProcessorSet) |
3693 | @@ -77,15 +39,20 @@ |
3694 | # Make it easy to filter out sample data |
3695 | store = IStore(Processor) |
3696 | store.execute("UPDATE Processor SET name = 'sample_data_' || name") |
3697 | - self.factory.makeProcessorFamily(name='q1') |
3698 | - self.factory.makeProcessorFamily(name='i686') |
3699 | - self.factory.makeProcessorFamily(name='g4') |
3700 | + self.factory.makeProcessor(name='q1') |
3701 | + self.factory.makeProcessor(name='i686') |
3702 | + self.factory.makeProcessor(name='g4') |
3703 | self.assertEquals( |
3704 | ['g4', 'i686', 'q1'], |
3705 | sorted( |
3706 | processor.name for processor in processor_set.getAll() |
3707 | if not processor.name.startswith('sample_data_'))) |
3708 | |
3709 | + def test_new(self): |
3710 | + proc = getUtility(IProcessorSet).new( |
3711 | + "avr2001", "The 2001 AVR", "Fast as light.") |
3712 | + self.assertProvides(proc, IProcessor) |
3713 | + |
3714 | |
3715 | class ProcessorSetWebServiceTests(TestCaseWithFactory): |
3716 | layer = DatabaseFunctionalLayer |
3717 | @@ -95,22 +62,21 @@ |
3718 | self.webservice = LaunchpadWebServiceCaller() |
3719 | |
3720 | def test_getByName(self): |
3721 | - self.factory.makeProcessorFamily(name='transmeta') |
3722 | + self.factory.makeProcessor(name='transmeta') |
3723 | logout() |
3724 | |
3725 | processor = self.webservice.named_get( |
3726 | '/+processors', 'getByName', name='transmeta', |
3727 | - api_version='devel', |
3728 | - ).jsonBody() |
3729 | + api_version='devel').jsonBody() |
3730 | self.assertEquals('transmeta', processor['name']) |
3731 | |
3732 | def test_default_collection(self): |
3733 | # Make it easy to filter out sample data |
3734 | store = IStore(Processor) |
3735 | store.execute("UPDATE Processor SET name = 'sample_data_' || name") |
3736 | - self.factory.makeProcessorFamily(name='q1') |
3737 | - self.factory.makeProcessorFamily(name='i686') |
3738 | - self.factory.makeProcessorFamily(name='g4') |
3739 | + self.factory.makeProcessor(name='q1') |
3740 | + self.factory.makeProcessor(name='i686') |
3741 | + self.factory.makeProcessor(name='g4') |
3742 | |
3743 | logout() |
3744 | |
3745 | |
3746 | === modified file 'lib/lp/soyuz/tests/test_publishing.py' |
3747 | --- lib/lp/soyuz/tests/test_publishing.py 2013-06-20 17:24:46 +0000 |
3748 | +++ lib/lp/soyuz/tests/test_publishing.py 2013-09-26 04:04:44 +0000 |
3749 | @@ -38,6 +38,7 @@ |
3750 | from lp.soyuz.interfaces.archivearch import IArchiveArchSet |
3751 | from lp.soyuz.interfaces.binarypackagename import IBinaryPackageNameSet |
3752 | from lp.soyuz.interfaces.component import IComponentSet |
3753 | +from lp.soyuz.interfaces.processor import IProcessorSet |
3754 | from lp.soyuz.interfaces.publishing import ( |
3755 | DeletionError, |
3756 | IPublishingSet, |
3757 | @@ -49,7 +50,6 @@ |
3758 | from lp.soyuz.interfaces.section import ISectionSet |
3759 | from lp.soyuz.model.distroseriesdifferencejob import find_waiting_jobs |
3760 | from lp.soyuz.model.distroseriespackagecache import DistroSeriesPackageCache |
3761 | -from lp.soyuz.model.processor import ProcessorFamily |
3762 | from lp.soyuz.model.publishing import ( |
3763 | BinaryPackagePublishingHistory, |
3764 | SourcePackagePublishingHistory, |
3765 | @@ -118,13 +118,14 @@ |
3766 | self.breezy_autotest_i386 = self.breezy_autotest['i386'] |
3767 | except NotFoundError: |
3768 | self.breezy_autotest_i386 = self.breezy_autotest.newArch( |
3769 | - 'i386', ProcessorFamily.get(1), False, self.person, |
3770 | - supports_virtualized=True) |
3771 | + 'i386', getUtility(IProcessorSet).getByName('386'), False, |
3772 | + self.person, supports_virtualized=True) |
3773 | try: |
3774 | self.breezy_autotest_hppa = self.breezy_autotest['hppa'] |
3775 | except NotFoundError: |
3776 | self.breezy_autotest_hppa = self.breezy_autotest.newArch( |
3777 | - 'hppa', ProcessorFamily.get(4), False, self.person) |
3778 | + 'hppa', getUtility(IProcessorSet).getByName('hppa'), False, |
3779 | + self.person) |
3780 | self.breezy_autotest.nominatedarchindep = self.breezy_autotest_i386 |
3781 | fake_chroot = self.addMockFile('fake_chroot.tar.gz') |
3782 | self.breezy_autotest_i386.addOrUpdateChroot(fake_chroot) |
3783 | @@ -837,17 +838,14 @@ |
3784 | self.distroseries = self.factory.makeDistroSeries( |
3785 | distribution=self.distro, name="crazy") |
3786 | self.archive = self.factory.makeArchive() |
3787 | - self.avr_family = self.factory.makeProcessorFamily( |
3788 | - name="avr", restricted=True) |
3789 | - self.factory.makeProcessor(self.avr_family, "avr2001") |
3790 | + self.avr = self.factory.makeProcessor(name="avr2001", restricted=True) |
3791 | self.avr_distroarch = self.factory.makeDistroArchSeries( |
3792 | - architecturetag='avr', processorfamily=self.avr_family, |
3793 | + architecturetag='avr', processor=self.avr, |
3794 | distroseries=self.distroseries, supports_virtualized=True) |
3795 | - self.sparc_family = self.factory.makeProcessorFamily(name="sparc", |
3796 | - restricted=False) |
3797 | - self.factory.makeProcessor(self.sparc_family, "sparc64") |
3798 | + self.sparc = self.factory.makeProcessor( |
3799 | + name="sparc64", restricted=False) |
3800 | self.sparc_distroarch = self.factory.makeDistroArchSeries( |
3801 | - architecturetag='sparc', processorfamily=self.sparc_family, |
3802 | + architecturetag='sparc', processor=self.sparc, |
3803 | distroseries=self.distroseries, supports_virtualized=True) |
3804 | self.distroseries.nominatedarchindep = self.sparc_distroarch |
3805 | self.addFakeChroots(self.distroseries) |
3806 | @@ -883,7 +881,7 @@ |
3807 | an explicit ArchiveArch association with the archive. |
3808 | """ |
3809 | available_archs = [self.sparc_distroarch, self.avr_distroarch] |
3810 | - getUtility(IArchiveArchSet).new(self.archive, self.avr_family) |
3811 | + getUtility(IArchiveArchSet).new(self.archive, self.avr) |
3812 | pubrec = self.getPubSource(architecturehintlist='any') |
3813 | self.assertEqual( |
3814 | [self.sparc_distroarch, self.avr_distroarch], |
3815 | @@ -922,7 +920,7 @@ |
3816 | architecture to architectures that are unrestricted or |
3817 | explicitly associated with the archive. |
3818 | """ |
3819 | - getUtility(IArchiveArchSet).new(self.archive, self.avr_family) |
3820 | + getUtility(IArchiveArchSet).new(self.archive, self.avr) |
3821 | pubrec = self.getPubSource(architecturehintlist='any') |
3822 | builds = pubrec.createMissingBuilds() |
3823 | self.assertEqual(2, len(builds)) |
3824 | |
3825 | === modified file 'lib/lp/soyuz/tests/test_sourcepackagerelease.py' |
3826 | --- lib/lp/soyuz/tests/test_sourcepackagerelease.py 2013-07-26 14:03:23 +0000 |
3827 | +++ lib/lp/soyuz/tests/test_sourcepackagerelease.py 2013-09-26 04:04:44 +0000 |
3828 | @@ -249,7 +249,7 @@ |
3829 | # archtag as the parent. |
3830 | das_derived = self.factory.makeDistroArchSeries( |
3831 | dsp.derived_series, architecturetag=das.architecturetag, |
3832 | - processorfamily=das.processorfamily, supports_virtualized=True) |
3833 | + processor=das.processor, supports_virtualized=True) |
3834 | # Now copy the package to the derived series, with binary. |
3835 | derived_archive = dsp.derived_series.main_archive |
3836 | getUtility(ISourcePackageFormatSelectionSet).add( |
3837 | |
3838 | === modified file 'lib/lp/soyuz/vocabularies.py' |
3839 | --- lib/lp/soyuz/vocabularies.py 2013-07-22 15:14:38 +0000 |
3840 | +++ lib/lp/soyuz/vocabularies.py 2013-09-26 04:04:44 +0000 |
3841 | @@ -10,7 +10,6 @@ |
3842 | 'FilteredDistroArchSeriesVocabulary', |
3843 | 'PackageReleaseVocabulary', |
3844 | 'PPAVocabulary', |
3845 | - 'ProcessorFamilyVocabulary', |
3846 | 'ProcessorVocabulary', |
3847 | ] |
3848 | |
3849 | @@ -36,10 +35,7 @@ |
3850 | from lp.soyuz.model.archive import Archive |
3851 | from lp.soyuz.model.component import Component |
3852 | from lp.soyuz.model.distroarchseries import DistroArchSeries |
3853 | -from lp.soyuz.model.processor import ( |
3854 | - Processor, |
3855 | - ProcessorFamily, |
3856 | - ) |
3857 | +from lp.soyuz.model.processor import Processor |
3858 | from lp.soyuz.model.sourcepackagerelease import SourcePackageRelease |
3859 | |
3860 | |
3861 | @@ -159,9 +155,3 @@ |
3862 | displayname = 'Select a processor' |
3863 | _table = Processor |
3864 | _orderBy = 'name' |
3865 | - |
3866 | - |
3867 | -class ProcessorFamilyVocabulary(NamedSQLObjectVocabulary): |
3868 | - displayname = 'Select a processor family' |
3869 | - _table = ProcessorFamily |
3870 | - _orderBy = 'name' |
3871 | |
3872 | === modified file 'lib/lp/soyuz/vocabularies.zcml' |
3873 | --- lib/lp/soyuz/vocabularies.zcml 2011-12-24 17:49:30 +0000 |
3874 | +++ lib/lp/soyuz/vocabularies.zcml 2013-09-26 04:04:44 +0000 |
3875 | @@ -68,17 +68,4 @@ |
3876 | <allow interface="lp.services.webapp.vocabulary.IHugeVocabulary"/> |
3877 | </class> |
3878 | |
3879 | - |
3880 | - <securedutility |
3881 | - name="ProcessorFamily" |
3882 | - component="lp.soyuz.vocabularies.ProcessorFamilyVocabulary" |
3883 | - provides="zope.schema.interfaces.IVocabularyFactory" |
3884 | - > |
3885 | - <allow interface="zope.schema.interfaces.IVocabularyFactory"/> |
3886 | - </securedutility> |
3887 | - |
3888 | - <class class="lp.soyuz.vocabularies.ProcessorFamilyVocabulary"> |
3889 | - <allow interface="lp.services.webapp.vocabulary.IHugeVocabulary"/> |
3890 | - </class> |
3891 | - |
3892 | </configure> |
3893 | |
3894 | === modified file 'lib/lp/testing/factory.py' |
3895 | --- lib/lp/testing/factory.py 2013-08-29 06:27:28 +0000 |
3896 | +++ lib/lp/testing/factory.py 2013-09-26 04:04:44 +0000 |
3897 | @@ -289,7 +289,7 @@ |
3898 | ) |
3899 | from lp.soyuz.interfaces.packagecopyjob import IPlainPackageCopyJobSource |
3900 | from lp.soyuz.interfaces.packageset import IPackagesetSet |
3901 | -from lp.soyuz.interfaces.processor import IProcessorFamilySet |
3902 | +from lp.soyuz.interfaces.processor import IProcessorSet |
3903 | from lp.soyuz.interfaces.publishing import IPublishingSet |
3904 | from lp.soyuz.interfaces.queue import IPackageUploadSet |
3905 | from lp.soyuz.interfaces.section import ISectionSet |
3906 | @@ -302,7 +302,6 @@ |
3907 | SourcePackageReleaseFile, |
3908 | ) |
3909 | from lp.soyuz.model.packagediff import PackageDiff |
3910 | -from lp.soyuz.model.processor import ProcessorFamilySet |
3911 | from lp.testing import ( |
3912 | admin_logged_in, |
3913 | ANONYMOUS, |
3914 | @@ -888,51 +887,24 @@ |
3915 | productseries=productseries, distroseries=distroseries, |
3916 | name=name, active=active, dateexpected=dateexpected)) |
3917 | |
3918 | - def makeProcessor(self, family=None, name=None, title=None, |
3919 | - description=None): |
3920 | + def makeProcessor(self, name=None, title=None, description=None, |
3921 | + restricted=False): |
3922 | """Create a new processor. |
3923 | |
3924 | - :param family: Family of the processor |
3925 | :param name: Name of the processor |
3926 | :param title: Optional title |
3927 | :param description: Optional description |
3928 | + :param restricted: If the processor is restricted. |
3929 | :return: A `IProcessor` |
3930 | """ |
3931 | if name is None: |
3932 | name = self.getUniqueString() |
3933 | - if family is None: |
3934 | - family = self.makeProcessorFamily() |
3935 | if title is None: |
3936 | title = "The %s processor" % name |
3937 | if description is None: |
3938 | - description = "The %s and processor and compatible processors" |
3939 | - return family.addProcessor(name, title, description) |
3940 | - |
3941 | - def makeProcessorFamily(self, name=None, title=None, description=None, |
3942 | - restricted=False): |
3943 | - """Create a new processor family. |
3944 | - |
3945 | - A default processor for the family will be created with the |
3946 | - same name as the family. |
3947 | - |
3948 | - :param name: Name of the family (e.g. x86) |
3949 | - :param title: Optional title of the family |
3950 | - :param description: Optional extended description |
3951 | - :param restricted: Whether the processor family is restricted |
3952 | - :return: A `IProcessorFamily` |
3953 | - """ |
3954 | - if name is None: |
3955 | - name = self.getUniqueString() |
3956 | - if description is None: |
3957 | - description = "Description of the %s processor family" % name |
3958 | - if title is None: |
3959 | - title = "%s and compatible processors." % name |
3960 | - family = getUtility(IProcessorFamilySet).new( |
3961 | - name, title, description, restricted=restricted) |
3962 | - # Make sure there's at least one processor in the family, so that |
3963 | - # other things can have a default processor. |
3964 | - self.makeProcessor(name=name, family=family) |
3965 | - return family |
3966 | + description = "The %s processor and compatible processors" % name |
3967 | + return getUtility(IProcessorSet).new( |
3968 | + name, title, description, restricted) |
3969 | |
3970 | def makeProductRelease(self, milestone=None, product=None, |
3971 | productseries=None): |
3972 | @@ -2651,24 +2623,24 @@ |
3973 | component) |
3974 | |
3975 | def makeDistroArchSeries(self, distroseries=None, |
3976 | - architecturetag=None, processorfamily=None, |
3977 | + architecturetag=None, processor=None, |
3978 | official=True, owner=None, |
3979 | supports_virtualized=False, enabled=True): |
3980 | """Create a new distroarchseries""" |
3981 | |
3982 | if distroseries is None: |
3983 | distroseries = self.makeDistroSeries() |
3984 | - if processorfamily is None: |
3985 | - processorfamily = self.makeProcessorFamily() |
3986 | + if processor is None: |
3987 | + processor = self.makeProcessor() |
3988 | if owner is None: |
3989 | owner = self.makePerson() |
3990 | - # XXX: architecturetag & processorfamily are tightly coupled. It's |
3991 | + # XXX: architecturetag & processor are tightly coupled. It's |
3992 | # wrong to just make a fresh architecture tag without also making a |
3993 | - # processor family to go with it (ideally with processors!) |
3994 | + # processor to go with it. |
3995 | if architecturetag is None: |
3996 | architecturetag = self.getUniqueString('arch') |
3997 | return distroseries.newArch( |
3998 | - architecturetag, processorfamily, official, owner, |
3999 | + architecturetag, processor, official, owner, |
4000 | supports_virtualized, enabled) |
4001 | |
4002 | def makeComponent(self, name=None): |
4003 | @@ -2783,8 +2755,7 @@ |
4004 | test environment. |
4005 | """ |
4006 | if processor is None: |
4007 | - processor_fam = ProcessorFamilySet().getByName('x86') |
4008 | - processor = processor_fam.processors[0] |
4009 | + processor = getUtility(IProcessorSet).getByName('386') |
4010 | if url is None: |
4011 | url = 'http://%s:8221/' % self.getUniqueString() |
4012 | if name is None: |
4013 | @@ -3625,8 +3596,7 @@ |
4014 | else: |
4015 | distroseries = self.makeDistroSeries() |
4016 | distroarchseries = self.makeDistroArchSeries( |
4017 | - distroseries=distroseries, |
4018 | - processorfamily=processor.family) |
4019 | + distroseries=distroseries, processor=processor) |
4020 | if archive is None: |
4021 | if source_package_release is None: |
4022 | archive = distroarchseries.main_archive |
4023 | |
4024 | === modified file 'utilities/soyuz-sampledata-setup.py' |
4025 | --- utilities/soyuz-sampledata-setup.py 2013-09-20 05:25:18 +0000 |
4026 | +++ utilities/soyuz-sampledata-setup.py 2013-09-26 04:04:44 +0000 |
4027 | @@ -46,7 +46,7 @@ |
4028 | from lp.services.scripts.base import LaunchpadScript |
4029 | from lp.soyuz.enums import SourcePackageFormat |
4030 | from lp.soyuz.interfaces.component import IComponentSet |
4031 | -from lp.soyuz.interfaces.processor import IProcessorFamilySet |
4032 | +from lp.soyuz.interfaces.processor import IProcessorSet |
4033 | from lp.soyuz.interfaces.section import ISectionSet |
4034 | from lp.soyuz.interfaces.sourcepackageformat import ( |
4035 | ISourcePackageFormatSelectionSet, |
4036 | @@ -146,11 +146,11 @@ |
4037 | # Avoid circular import. |
4038 | from lp.soyuz.model.distroarchseries import DistroArchSeries |
4039 | |
4040 | - family = getUtility(IProcessorFamilySet).getByName(architecture_name) |
4041 | + processor = getUtility(IProcessorSet).getByName(architecture_name) |
4042 | archseries = DistroArchSeries( |
4043 | - distroseries=distroseries, processorfamily=family, |
4044 | - processor=family.processors[0], owner=distroseries.owner, |
4045 | - official=True, architecturetag=architecture_name) |
4046 | + distroseries=distroseries, processor=processor, |
4047 | + owner=distroseries.owner, official=True, |
4048 | + architecturetag=architecture_name) |
4049 | IMasterStore(DistroArchSeries).add(archseries) |
4050 | |
4051 |