Merge lp:~julian-edwards/launchpad/poppy-warn-unsigned-bug-374019 into lp:launchpad
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Julian Edwards | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 12470 | ||||
Proposed branch: | lp:~julian-edwards/launchpad/poppy-warn-unsigned-bug-374019 | ||||
Merge into: | lp:launchpad | ||||
Diff against target: |
273 lines (+184/-2) 5 files modified
daemons/poppy-sftp.tac (+4/-0) lib/lp/poppy/tests/test_poppy.py (+32/-0) lib/lp/poppy/tests/test_twistedftp.py (+94/-0) lib/lp/poppy/twistedftp.py (+53/-1) versions.cfg (+1/-1) |
||||
To merge this branch: | bzr merge lp:~julian-edwards/launchpad/poppy-warn-unsigned-bug-374019 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Abel Deuring (community) | code | Approve | |
Review via email: mp+51144@code.launchpad.net |
Commit message
[r=adeuring][bug=374019] Add support to the new twisted-based poppy ftp server to reject invalidly gpg-signed uploaded .changes files directly in the FTP session.
Description of the change
Add support to the new twisted-based poppy ftp server to reject invalidly gpg-signed uploaded .changes files directly in the FTP session.
This change depends on a patch to Twisted being applied, which is being tracked at http://
It works by creating a new custom file-writer, which checks to see if the file is a .changes file, and does a quick lookup of the GPG key before ending the transfer session.
I've tested this approach using dput, and dput gets a lovely error message printed out like this:
Uploading to dogfood (via ftp to dogfood.
Uploading hello_2.
Uploading hello_2.
Uploading hello_2.
(15:48:46) adeuring: bigjools: PoppyAnonymousS hell.openForWri ting() has a "catch-all" except. I think we do not want to catch KeyboardInterrupt and SystemExit. And I think we should log an error for other exceptions.
(15:49:00) adeuring: otherwise, the branch looks good, I think
(15:50:07) bigjools: adeuring: that was cargo-culted from the parent class... I wasn't sure what to do about it TBH
(15:51:40) adeuring: bigjools: admittedly, I am not familiar with twisted, so I am not sure about KBInterrupt and SystemExit. But nevertheless I think we should log other exceptions.
(15:52:54) adeuring: "eating" exceptions simply scares me ;)
(15:53:12) bigjools: adeuring: yeah
(15:54:27) bigjools: adeuring: so I'll re-raise KeyboardInterrupt and SystemExit
(15:54:44) bigjools: adeuring: oh wait
(15:55:23) bigjools: adeuring: yes twisted has confused us both momentarily - the defer.fail() is effectively the same as re-raising the exception, it gets dealt with later
(15:56:10) adeuring: bigjools: intersting. So, IOError and OSError are re-raised too?
(15:56:19) adeuring: ah, no, there no fail() call
(15:56:26) bigjools: adeuring: no, they are converted to ftp errors
(15:56:48) bigjools: ftp.errnoToFailure will return a defer.fail
(15:57:23) adeuring: bigjools: right, thanks for the explanation, so r=me. But perhaps a small comment that twisted properly deals with the exceptions? (just to avoid the same question I asked again)?
(15:57:36) bigjools: adeuring: yup, will do, thanks for the review