Merge lp:~wgrant/launchpad/careless-executioner into lp:launchpad

Proposed by William Grant
Status: Work in progress
Proposed branch: lp:~wgrant/launchpad/careless-executioner
Merge into: lp:launchpad
Diff against target: 81 lines (+24/-13)
2 files modified
lib/lp/archivepublisher/deathrow.py (+13/-8)
lib/lp/archivepublisher/tests/deathrow.txt (+11/-5)
To merge this branch: bzr merge lp:~wgrant/launchpad/careless-executioner
Reviewer Review Type Date Requested Status
Launchpad code reviewers Pending
Review via email: mp+74935@code.launchpad.net

Description of the change

Make the LFC check in deathrow optional, and restrict condemned collection to Dapper so we can get rid of it.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/archivepublisher/deathrow.py'
2--- lib/lp/archivepublisher/deathrow.py 2011-08-30 04:56:29 +0000
3+++ lib/lp/archivepublisher/deathrow.py 2011-09-13 11:24:28 +0000
4@@ -175,13 +175,15 @@
5 else:
6 raise AssertionError("%r is not supported." % publication_class)
7
8- clauses.append("""
9- LibraryFileAlias.content = LibraryFileContent.id AND
10- LibraryFileAlias.filename = %s AND
11- LibraryFileContent.md5 = %s
12- """ % sqlvalues(filename, file_md5))
13- clauseTables.extend(
14- ['LibraryFileAlias', 'LibraryFileContent'])
15+ clauses.append("LibraryFileAlias.filename = %s" % sqlvalues(filename))
16+ clauseTables.append('LibraryFileAlias')
17+
18+ if file_md5 is not None:
19+ clauses.append("""
20+ LibraryFileAlias.content = LibraryFileContent.id AND
21+ LibraryFileContent.md5 = %s
22+ """ % sqlvalues(file_md5))
23+ clauseTables.append('LibraryFileContent')
24
25 all_publications = publication_class.select(
26 " AND ".join(clauses), clauseTables=clauseTables)
27@@ -230,7 +232,10 @@
28 """
29 for pub_file in pub_record.files:
30 filename = pub_file.libraryfilealiasfilename
31- file_md5 = pub_file.libraryfilealias.content.md5
32+ if pub_file.libraryfilealias.content:
33+ file_md5 = pub_file.libraryfilealias.content.md5
34+ else:
35+ file_md5 = None
36
37 self.logger.debug("Checking %s (%s)" % (filename, file_md5))
38
39
40=== modified file 'lib/lp/archivepublisher/tests/deathrow.txt'
41--- lib/lp/archivepublisher/tests/deathrow.txt 2011-04-05 08:28:30 +0000
42+++ lib/lp/archivepublisher/tests/deathrow.txt 2011-09-13 11:24:28 +0000
43@@ -235,6 +235,12 @@
44 superseded-bin_666_i386.deb: OK
45 superseded_666.dsc: OK
46
47+ >>> from zope.security.proxy import removeSecurityProxy
48+ >>> from lp.testing.dbuser import dbuser
49+ >>> lfa = published_binary.binarypackagerelease.files[0].libraryfile
50+ >>> with dbuser('librariangc'):
51+ ... removeSecurityProxy(lfa).content = None
52+
53 Run DeathRow against the current 'removable' context.
54
55 >>> disk_pool = DiskPool(pool_path, temp_path, FakeLogger())
56@@ -338,9 +344,9 @@
57 >>> death_row.reap()
58 DEBUG 0 Sources
59 DEBUG 2 Binaries
60- DEBUG Checking stuck-bin_666_i386.deb (21c2e59531c8710156d34a3c30ac81d5)
61+ DEBUG Checking stuck-bin_666_i386.deb (None)
62 DEBUG Cannot remove.
63- DEBUG Checking stuck-bin_666_i386.deb (21c2e59531c8710156d34a3c30ac81d5)
64+ DEBUG Checking stuck-bin_666_i386.deb (None)
65 DEBUG Already verified.
66 INFO Removing 0 files marked for reaping
67 INFO Total bytes freed: 0
68@@ -362,10 +368,10 @@
69 >>> death_row.reap()
70 DEBUG 0 Sources
71 DEBUG 3 Binaries
72- DEBUG Checking stuck-bin_666_i386.deb (21c2e59531c8710156d34a3c30ac81d5)
73- DEBUG Checking stuck-bin_666_i386.deb (21c2e59531c8710156d34a3c30ac81d5)
74+ DEBUG Checking stuck-bin_666_i386.deb (None)
75+ DEBUG Checking stuck-bin_666_i386.deb (None)
76 DEBUG Already verified.
77- DEBUG Checking stuck-bin_666_i386.deb (21c2e59531c8710156d34a3c30ac81d5)
78+ DEBUG Checking stuck-bin_666_i386.deb (None)
79 DEBUG Already verified.
80 INFO Removing 1 files marked for reaping
81 DEBUG Removing removed-ignored/stuck-bin_666_i386.deb from main