~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/archivepublisher/publishing.py

  • Committer: Jeroen Vermeulen
  • Date: 2011-08-08 07:31:08 UTC
  • mto: This revision was merged to the branch mainline in revision 13637.
  • Revision ID: jeroen.vermeulen@canonical.com-20110808073108-36jfyvegwaq3sx71
Make publishing scripts share a single lock file for a system.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright 2009 Canonical Ltd.  This software is licensed under the
 
1
# Copyright 2009-2011 Canonical Ltd.  This software is licensed under the
2
2
# GNU Affero General Public License version 3 (see the file LICENSE).
3
3
 
4
4
__all__ = [
 
5
    'GLOBAL_PUBLISHER_LOCK',
5
6
    'Publisher',
6
7
    'getPublisher',
7
8
    ]
19
20
from canonical.database.sqlbase import sqlvalues
20
21
from canonical.librarian.client import LibrarianClient
21
22
from lp.archivepublisher import HARDCODED_COMPONENT_ORDER
22
 
from lp.archivepublisher.config import (
23
 
    getPubConfig,
24
 
    )
 
23
from lp.archivepublisher.config import getPubConfig
25
24
from lp.archivepublisher.diskpool import DiskPool
26
25
from lp.archivepublisher.domination import Dominator
27
 
from lp.archivepublisher.model.ftparchive import FTPArchiveHandler
28
26
from lp.archivepublisher.htaccess import (
29
27
    htpasswd_credentials_for_archive,
30
28
    write_htaccess,
33
31
from lp.archivepublisher.interfaces.archivesigningkey import (
34
32
    IArchiveSigningKey,
35
33
    )
 
34
from lp.archivepublisher.model.ftparchive import FTPArchiveHandler
36
35
from lp.archivepublisher.utils import (
37
36
    get_ppa_reference,
38
37
    RepositoryIndexFile,
45
44
    PackagePublishingStatus,
46
45
    )
47
46
 
 
47
# Use this as the lock file name for all scripts that may manipulate
 
48
# archives in the filesystem.  In a Launchpad(Cron)Script, set
 
49
# lockfilename to this value to make it use the shared lock.
 
50
GLOBAL_PUBLISHER_LOCK = 'launchpad-publisher.lock'
 
51
 
48
52
 
49
53
def reorder_components(components):
50
54
    """Return a list of the components provided.