Merge lp:~jpds/launchpad/fix_565345-mirror-prober-agent into lp:launchpad
Proposed by
Jonathan Davies
on 2010-04-19
| Status: | Merged |
|---|---|
| Approved by: | Jeroen T. Vermeulen on 2010-04-20 |
| Approved revision: | no longer in the source branch. |
| Merged at revision: | 10747 |
| Proposed branch: | lp:~jpds/launchpad/fix_565345-mirror-prober-agent |
| Merge into: | lp:launchpad |
| Diff against target: |
60 lines (+23/-2) 2 files modified
lib/lp/registry/scripts/distributionmirror_prober.py (+2/-0) lib/lp/registry/tests/test_distributionmirror_prober.py (+21/-2) |
| To merge this branch: | bzr merge lp:~jpds/launchpad/fix_565345-mirror-prober-agent |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Jeroen T. Vermeulen (community) | code | 2010-04-19 | Approve on 2010-04-20 |
|
Review via email:
|
|||
Commit Message
Added "User-Agent" header to the mirror prober.
Description of the Change
= Summary =
This branch adds a "User-Agent" header to the mirror prober so that probes can be identified easily in HTTPd logs.
To post a comment you must log in.
review:
Needs Fixing
(code)
| Jeroen T. Vermeulen (jtv) wrote : | # |
Thanks for the changes. You're good to go!
review:
Approve
(code)

A good idea, especially since we've traditionally asked bots accessing our site to provide meaningful user agent identification. Shouldn't ours include a URL as well, by the way?
It's a shame you have to mess with sendHeader in this way, but the only alternative I see is to make FakeTransport log its header and that's probably more effort than it's worth.
A few points remain though: ls(...) ; just invoke it. It'll raise an exception if it fails. 'User-Agent' ]?
* Don't return self.assertEqua
* Don't test "headers[1]"—a hard-coded index is far too fragile. Why not make "headers" a dict and test headers[
Jeroen