Merge lp:~stevenk/launchpad/db-ids-enabled-dases into lp:launchpad/db-devel

Proposed by Steve Kowalik
Status: Merged
Approved by: Steve Kowalik
Approved revision: no longer in the source branch.
Merged at revision: 9855
Proposed branch: lp:~stevenk/launchpad/db-ids-enabled-dases
Merge into: lp:launchpad/db-devel
Diff against target: 45 lines (+23/-1)
2 files modified
lib/lp/soyuz/scripts/initialise_distroseries.py (+2/-1)
lib/lp/soyuz/scripts/tests/test_initialise_distroseries.py (+21/-0)
To merge this branch: bzr merge lp:~stevenk/launchpad/db-ids-enabled-dases
Reviewer Review Type Date Requested Status
Jelmer Vernooij (community) code Approve
Review via email: mp+36823@code.launchpad.net

Commit message

Don't copy disabled DASes to the child distroseries during InitialiseDistroSeries.

Description of the change

This branch makes a small change to InitialiseDistroSeries to not copy disabled DistroArchSerieses (!) when we copy them into the child distroseries. I've added a test, and as a bonus, it doesn't use sampledata.

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Nice and straightforward fix.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/soyuz/scripts/initialise_distroseries.py'
--- lib/lp/soyuz/scripts/initialise_distroseries.py 2010-09-22 06:42:40 +0000
+++ lib/lp/soyuz/scripts/initialise_distroseries.py 2010-09-28 07:37:42 +0000
@@ -134,7 +134,8 @@
134 INSERT INTO DistroArchSeries134 INSERT INTO DistroArchSeries
135 (distroseries, processorfamily, architecturetag, owner, official)135 (distroseries, processorfamily, architecturetag, owner, official)
136 SELECT %s, processorfamily, architecturetag, %s, official136 SELECT %s, processorfamily, architecturetag, %s, official
137 FROM DistroArchSeries WHERE distroseries = %s %s137 FROM DistroArchSeries WHERE distroseries = %s
138 AND enabled = TRUE %s
138 """ % (sqlvalues(self.distroseries, self.distroseries.owner,139 """ % (sqlvalues(self.distroseries, self.distroseries.owner,
139 self.parent) + (include,)))140 self.parent) + (include,)))
140141
141142
=== modified file 'lib/lp/soyuz/scripts/tests/test_initialise_distroseries.py'
--- lib/lp/soyuz/scripts/tests/test_initialise_distroseries.py 2010-09-22 06:42:40 +0000
+++ lib/lp/soyuz/scripts/tests/test_initialise_distroseries.py 2010-09-28 07:37:42 +0000
@@ -246,6 +246,27 @@
246 self.assertEqual(foobuntu.binarycount, 0)246 self.assertEqual(foobuntu.binarycount, 0)
247 self.assertEqual(builds.count(), 5)247 self.assertEqual(builds.count(), 5)
248248
249 def test_do_not_copy_disabled_dases(self):
250 # DASes that are disabled in the parent will not be copied
251 i386 = self.factory.makeProcessorFamily()
252 ppc = self.factory.makeProcessorFamily()
253 parent = self.factory.makeDistroSeries()
254 i386_das = self.factory.makeDistroArchSeries(
255 distroseries=parent, processorfamily=i386)
256 ppc_das = self.factory.makeDistroArchSeries(
257 distroseries=parent, processorfamily=ppc)
258 ppc_das.enabled = False
259 parent.nominatedarchindep = i386_das
260 foobuntu = self._create_distroseries(parent)
261 ids = InitialiseDistroSeries(foobuntu)
262 ids.check()
263 ids.initialise()
264 das = list(IStore(DistroArchSeries).find(
265 DistroArchSeries, distroseries = foobuntu))
266 self.assertEqual(len(das), 1)
267 self.assertEqual(
268 das[0].architecturetag, i386_das.architecturetag)
269
249 def test_script(self):270 def test_script(self):
250 # Do an end-to-end test using the command-line tool271 # Do an end-to-end test using the command-line tool
251 uploader = self.factory.makePerson()272 uploader = self.factory.makePerson()

Subscribers

People subscribed via source and target branches

to status/vote changes: