Merge lp:~wgrant/launchpad/please-dont-generateListings into lp:launchpad

Proposed by William Grant
Status: Merged
Merged at revision: 16985
Proposed branch: lp:~wgrant/launchpad/please-dont-generateListings
Merge into: lp:launchpad
Diff against target: 67 lines (+0/-32)
2 files modified
lib/lp/archivepublisher/scripts/publish_ftpmaster.py (+0/-18)
lib/lp/archivepublisher/tests/test_publish_ftpmaster.py (+0/-14)
To merge this branch: bzr merge lp:~wgrant/launchpad/please-dont-generateListings
Reviewer Review Type Date Requested Status
Celso Providelo (community) Approve
Review via email: mp+215925@code.launchpad.net

Commit message

Drop ls-lR.gz generation from publish-ftpmaster, as it's now done by lp:ubuntu-archive-publishing. This is mostly to let finalize.d trigger proposed-migration moments after the dists switch, rather than waiting for ls-lR to complete.

Description of the change

We want to trigger proposed-migration as soon as Launchpad performs the dists switch. Rather than adding a new run-parts hook, we'll reuse finalize.d and move the expensive bit between the dists switch and finalize.d (ls-lR generation) into a later step of finalize.d.

https://code.launchpad.net/~wgrant/ubuntu-archive-publishing/ls-lR/+merge/215916 adds the new hook to finalize.d. This branch removes the built-in Launchpad ls-lR generation.

To post a comment you must log in.
Revision history for this message
Celso Providelo (cprov) wrote :

Great job!

finalize.d is excellent for accommodating *specialties* like this.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/archivepublisher/scripts/publish_ftpmaster.py'
2--- lib/lp/archivepublisher/scripts/publish_ftpmaster.py 2014-03-11 03:47:50 +0000
3+++ lib/lp/archivepublisher/scripts/publish_ftpmaster.py 2014-04-15 16:50:41 +0000
4@@ -476,23 +476,6 @@
5 os.rename(backup_dists, dists)
6 os.rename(temp_dists, backup_dists)
7
8- def generateListings(self, distribution):
9- """Create ls-lR.gz listings."""
10- self.logger.debug("Creating ls-lR.gz...")
11- lslr = "ls-lR.gz"
12- lslr_new = "." + lslr + ".new"
13- for purpose, archive_config in self.configs[distribution].iteritems():
14- lslr_file = os.path.join(archive_config.archiveroot, lslr)
15- new_lslr_file = os.path.join(archive_config.archiveroot, lslr_new)
16- if file_exists(new_lslr_file):
17- os.remove(new_lslr_file)
18- self.executeShell(
19- "cd -- '%s' ; TZ=UTC ls -lR | gzip -9n >'%s'"
20- % (archive_config.archiveroot, lslr_new),
21- failure=LaunchpadScriptFailure(
22- "Failed to create %s for %s." % (lslr, purpose.title)))
23- os.rename(new_lslr_file, lslr_file)
24-
25 def clearEmptyDirs(self, distribution):
26 """Clear out any redundant empty directories."""
27 for archive_config in self.configs[distribution].itervalues():
28@@ -631,7 +614,6 @@
29 if not self.options.security_only:
30 self.rsyncBackupDists(distribution)
31 self.publish(distribution, security_only=False)
32- self.generateListings(distribution)
33 self.clearEmptyDirs(distribution)
34 self.runFinalizeParts(distribution, security_only=False)
35
36
37=== modified file 'lib/lp/archivepublisher/tests/test_publish_ftpmaster.py'
38--- lib/lp/archivepublisher/tests/test_publish_ftpmaster.py 2014-03-11 03:47:50 +0000
39+++ lib/lp/archivepublisher/tests/test_publish_ftpmaster.py 2014-04-15 16:50:41 +0000
40@@ -314,12 +314,6 @@
41 distro = self.factory.makeDistribution(no_pubconf=True)
42 self.makeScript(distro).main()
43
44- def test_produces_listings(self):
45- distro = self.makeDistroWithPublishDirectory()
46- self.makeScript(distro).main()
47- self.assertTrue(
48- path_exists(get_archive_root(get_pub_config(distro)), 'ls-lR.gz'))
49-
50 def test_can_run_twice(self):
51 test_publisher = SoyuzTestPublisher()
52 distroseries = test_publisher.setUpDefaultDistroSeries()
53@@ -532,14 +526,6 @@
54 missing_parameters = required_parameters.difference(set(env.keys()))
55 self.assertEqual(set(), missing_parameters)
56
57- def test_generateListings_writes_ls_lR_gz(self):
58- distro = self.makeDistroWithPublishDirectory()
59- script = self.makeScript(distro)
60- script.setUp()
61- script.setUpDirs()
62- script.generateListings(distro)
63- pass
64-
65 def test_clearEmptyDirs_cleans_up_empty_directories(self):
66 distro = self.makeDistroWithPublishDirectory()
67 script = self.makeScript(distro)