Merge lp:~julian-edwards/launchpad/twisted-ftp-poppy into lp:launchpad
Status: | Merged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Approved by: | Leonard Richardson | ||||||||
Approved revision: | no longer in the source branch. | ||||||||
Merged at revision: | 12452 | ||||||||
Proposed branch: | lp:~julian-edwards/launchpad/twisted-ftp-poppy | ||||||||
Merge into: | lp:launchpad | ||||||||
Diff against target: |
656 lines (+289/-69) 9 files modified
daemons/poppy-sftp.tac (+17/-17) lib/canonical/config/schema-lazr.conf (+3/-0) lib/lp/poppy/__init__.py (+17/-1) lib/lp/poppy/hooks.py (+18/-2) lib/lp/poppy/tests/test_poppy.py (+59/-45) lib/lp/poppy/tests/test_twistedsftp.py (+1/-1) lib/lp/poppy/twistedftp.py (+152/-0) lib/lp/poppy/twistedsftp.py (+1/-3) lib/lp/services/twistedsupport/loggingsupport.py (+21/-0) |
||||||||
To merge this branch: | bzr merge lp:~julian-edwards/launchpad/twisted-ftp-poppy | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jonathan Lange (community) | Approve | ||
Leonard Richardson (community) | Approve | ||
Review via email: mp+50721@code.launchpad.net |
Commit message
[testfix] [r=jml,leonardr][bug=251685,586695] An implementation of the Poppy FTP server using Twisted.
Description of the change
= Summary =
Extend poppy-sftp to also handle ftp.
== Proposed fix ==
Package uploads are currently handled either in Poppy (FTP) or Poppy-sftp
(SFTP). The former is written using Zope's FTP server, the latter using
Twisted.
The Zope FTP server has a number of bugs, so this branch adds FTP support via
the Twisted libraries.
== Pre-implementation notes ==
None, I suck.
== Implementation details ==
Some interesting points:
* Poppy doesn't really care about authentication, it lets any credentials
upload files, whether it be anonymous or otherwise. Twisted has a special
mode where if anyone logs in as "anonymous" it will prevent any file uploads.
This behaviour is hard-coded in the base FTPShell class. To get around this,
the FTPFactory's "userAnonymous" is modified to a user called
"userthatwillne
anonymous access.
* The old port number was passed on the command line, it's now set in config.
* The tests were easy to fix since they just needed the PoppyTac fixture
swapped in in favour of the old PoppyTestSetup.
* The old Poppy had a file mode bug where it set group execute on uploaded
files, this is reflected in the test changes for the new ftp service.
* The poppy server does post-processing of the upload. There's no way to
know when this is finished, so the test just sleeps for a few seconds. See
bug 586695. The old poppy code had some weird hook to print output to stdout
when it finished uploading, we might need to do that here too.
== Tests ==
bin/test -cvv test_poppy
== Demo and Q/A ==
= Launchpad lint =
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
lib/canonical
lib/lp/
daemons/
./lib/canonical
522: Line exceeds 78 characters.
1034: Line exceeds 78 characters.
The existing test coverage looks good, which helps compensate for my relative ignorance around this part of the code.
So if someone actually logs in as "userthatwillne verhappen" , they won't be able to upload any files? I don't think this is a big deal, just trying to understand what's going on. What would happen if you set that to None?
If you made 0102674 a constant you wouldn't have to explain it twice.