Re: [Launchpad-reviewers] [Merge] lp:~wgrant/launchpad/please-dont-generateListings into lp:launchpad

2014-04-15 Thread Celso Providelo
Review: Approve

Great job!

finalize.d is excellent for accommodating *specialties* like this.
-- 
https://code.launchpad.net/~wgrant/launchpad/please-dont-generateListings/+merge/215925
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.

___
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to : launchpad-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp


[Launchpad-reviewers] [Merge] lp:~wgrant/launchpad/please-dont-generateListings into lp:launchpad

2014-04-15 Thread William Grant
William Grant has proposed merging 
lp:~wgrant/launchpad/please-dont-generateListings into lp:launchpad.

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.

Requested reviews:
  Celso Providelo (cprov)
Related bugs:
  Bug #1256140 in Launchpad itself: Please give the publisher a run-parts 
breakpoint in lieu of ls-lR
  https://bugs.launchpad.net/launchpad/+bug/1256140

For more details, see:
https://code.launchpad.net/~wgrant/launchpad/please-dont-generateListings/+merge/215925

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.
-- 
https://code.launchpad.net/~wgrant/launchpad/please-dont-generateListings/+merge/215925
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.
=== modified file 'lib/lp/archivepublisher/scripts/publish_ftpmaster.py'
--- lib/lp/archivepublisher/scripts/publish_ftpmaster.py	2014-03-11 03:47:50 +
+++ lib/lp/archivepublisher/scripts/publish_ftpmaster.py	2014-04-15 16:50:41 +
@@ -476,23 +476,6 @@
 os.rename(backup_dists, dists)
 os.rename(temp_dists, backup_dists)
 
-def generateListings(self, distribution):
-Create ls-lR.gz listings.
-self.logger.debug(Creating ls-lR.gz...)
-lslr = ls-lR.gz
-lslr_new = . + lslr + .new
-for purpose, archive_config in self.configs[distribution].iteritems():
-lslr_file = os.path.join(archive_config.archiveroot, lslr)
-new_lslr_file = os.path.join(archive_config.archiveroot, lslr_new)
-if file_exists(new_lslr_file):
-os.remove(new_lslr_file)
-self.executeShell(
-cd -- '%s' ; TZ=UTC ls -lR | gzip -9n '%s'
-% (archive_config.archiveroot, lslr_new),
-failure=LaunchpadScriptFailure(
-Failed to create %s for %s. % (lslr, purpose.title)))
-os.rename(new_lslr_file, lslr_file)
-
 def clearEmptyDirs(self, distribution):
 Clear out any redundant empty directories.
 for archive_config in self.configs[distribution].itervalues():
@@ -631,7 +614,6 @@
 if not self.options.security_only:
 self.rsyncBackupDists(distribution)
 self.publish(distribution, security_only=False)
-self.generateListings(distribution)
 self.clearEmptyDirs(distribution)
 self.runFinalizeParts(distribution, security_only=False)
 

=== modified file 'lib/lp/archivepublisher/tests/test_publish_ftpmaster.py'
--- lib/lp/archivepublisher/tests/test_publish_ftpmaster.py	2014-03-11 03:47:50 +
+++ lib/lp/archivepublisher/tests/test_publish_ftpmaster.py	2014-04-15 16:50:41 +
@@ -314,12 +314,6 @@
 distro = self.factory.makeDistribution(no_pubconf=True)
 self.makeScript(distro).main()
 
-def test_produces_listings(self):
-distro = self.makeDistroWithPublishDirectory()
-self.makeScript(distro).main()
-self.assertTrue(
-path_exists(get_archive_root(get_pub_config(distro)), 'ls-lR.gz'))
-
 def test_can_run_twice(self):
 test_publisher = SoyuzTestPublisher()
 distroseries = test_publisher.setUpDefaultDistroSeries()
@@ -532,14 +526,6 @@
 missing_parameters = required_parameters.difference(set(env.keys()))
 self.assertEqual(set(), missing_parameters)
 
-def test_generateListings_writes_ls_lR_gz(self):
-distro = self.makeDistroWithPublishDirectory()
-script = self.makeScript(distro)
-script.setUp()
-script.setUpDirs()
-script.generateListings(distro)
-pass
-
 def test_clearEmptyDirs_cleans_up_empty_directories(self):
 distro = self.makeDistroWithPublishDirectory()
 script = self.makeScript(distro)

___
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to : launchpad-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp