~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/poppy/twistedftp.py

  • Committer: Steve Kowalik
  • Date: 2011-08-07 04:05:52 UTC
  • mto: This revision was merged to the branch mainline in revision 13626.
  • Revision ID: stevenk@ubuntu.com-20110807040552-mwnxo0flmhvl35e8
Correct the notification based on review comments, and remove request{,ed}
from the function names, switching to create{,d}.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
import os
14
14
import tempfile
15
15
 
16
 
from twisted.application import (
17
 
    service,
18
 
    strports,
19
 
    )
20
 
from twisted.cred import (
21
 
    checkers,
22
 
    credentials,
23
 
    )
24
 
from twisted.cred.portal import (
25
 
    IRealm,
26
 
    Portal,
27
 
    )
 
16
from twisted.application import service, strports
 
17
from twisted.cred import checkers, credentials
 
18
from twisted.cred.portal import IRealm, Portal
28
19
from twisted.internet import defer
29
20
from twisted.protocols import ftp
30
21
from twisted.python import filepath
 
22
 
 
23
from zope.interface import implements
31
24
from zope.component import getUtility
32
 
from zope.interface import implements
33
 
 
 
25
 
 
26
from canonical.launchpad.interfaces.gpghandler import (
 
27
    GPGVerificationError,
 
28
    IGPGHandler,
 
29
    )
 
30
 
 
31
from canonical.config import config
34
32
from lp.poppy import get_poppy_root
35
33
from lp.poppy.filesystem import UploadFileSystem
36
34
from lp.poppy.hooks import Hooks
37
35
from lp.registry.interfaces.gpg import IGPGKeySet
38
 
from lp.services.config import config
39
36
from lp.services.database import read_transaction
40
 
from lp.services.gpg.interfaces import (
41
 
    GPGVerificationError,
42
 
    IGPGHandler,
43
 
    )
44
37
 
45
38
 
46
39
class PoppyAccessCheck:
174
167
            sig = getUtility(IGPGHandler).getVerifiedSignatureResilient(
175
168
                file(signed_file, "rb").read())
176
169
        except GPGVerificationError, error:
177
 
            log = logging.getLogger("poppy-sftp")
178
 
            log.info("GPGVerificationError, extra debug output follows:")
179
 
            for attr in ("args", "code", "signatures", "source"):
180
 
                if hasattr(error, attr):
181
 
                    log.info("%s: %s", attr, getattr(error, attr))
182
170
            return ("Changes file must be signed with a valid GPG "
183
171
                    "signature: %s" % error)
184
172