~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/soyuz/scripts/processaccepted.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-08-09 10:30:43 UTC
  • mfrom: (13607.3.4 bug-820796)
  • Revision ID: launchpad@pqm.canonical.com-20110809103043-865kaypngiquws1f
[r=henninge][bug=820796] Make publisher scripts use the same lock
        file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
    'ProcessAccepted',
13
13
    ]
14
14
 
 
15
from optparse import OptionValueError
15
16
import sys
16
17
 
17
18
from debian.deb822 import Deb822Dict
18
 
from optparse import OptionValueError
19
19
from zope.component import getUtility
20
20
from zope.security.proxy import removeSecurityProxy
21
21
 
252
252
    them for publishing as appropriate.
253
253
    """
254
254
 
 
255
    @property
 
256
    def lockfilename(self):
 
257
        """See `LaunchpadScript`."""
 
258
        # Avoid circular imports.
 
259
        from lp.archivepublisher.publishing import GLOBAL_PUBLISHER_LOCK
 
260
        return GLOBAL_PUBLISHER_LOCK
 
261
 
255
262
    def add_my_options(self):
256
263
        """Command line options for this script."""
257
264
        self.parser.add_option(
264
271
            default=False, help="Process all Ubuntu-derived distributions.")
265
272
 
266
273
        self.parser.add_option(
267
 
            "--ppa", action="store_true",
268
 
            dest="ppa", metavar="PPA", default=False,
 
274
            "--ppa", action="store_true", dest="ppa", default=False,
269
275
            help="Run only over PPA archives.")
270
276
 
271
277
        self.parser.add_option(
272
 
            "--copy-archives", action="store_true",
273
 
            dest="copy_archives", metavar="COPY_ARCHIVES",
 
278
            "--copy-archives", action="store_true", dest="copy_archives",
274
279
            default=False, help="Run only over COPY archives.")
275
280
 
276
 
    @property
277
 
    def lockfilename(self):
278
 
        """Override LaunchpadScript's lock file name."""
279
 
        return "/var/lock/launchpad-upload-queue.lock"
280
 
 
281
281
    def _commit(self):
282
282
        """Commit transaction (unless in dry-run mode)."""
283
283
        if self.options.dryrun: