Merge lp://qastaging/~danilo/simplestreams/custom-user-agent into lp://qastaging/simplestreams
Status: | Merged |
---|---|
Merged at revision: | 429 |
Proposed branch: | lp://qastaging/~danilo/simplestreams/custom-user-agent |
Merge into: | lp://qastaging/simplestreams |
Diff against target: |
383 lines (+224/-21) 6 files modified
simplestreams/contentsource.py (+11/-5) simplestreams/mirrors/__init__.py (+23/-5) simplestreams/mirrors/glance.py (+1/-1) tests/httpserver.py (+43/-0) tests/unittests/test_contentsource.py (+30/-10) tests/unittests/test_mirrorreaders.py (+116/-0) |
To merge this branch: | bzr merge lp://qastaging/~danilo/simplestreams/custom-user-agent |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
simplestreams-dev | Pending | ||
Review via email: mp+292403@code.qastaging.launchpad.net |
Description of the change
= Add user-agent support to simplestreams =
This branch adds user-agent support as required by Landscape's use of glance-
Because of the code structure, there's some not-very-nice code in here, mainly the use of url_reader_factory function, but without knowing what parts of simplestreams API we want to keep backward compatible, I refrained from changing anything of the existing code too much.
There are tests for all the new code, and for some of the old code that was untested (if I missed something, do let me know).
I've also manually tested this with our charm from lp:~danilo/charms/trusty/glance-simplestreams-sync/use-upstream-user-agent-support (cs:~danilo/
with manually copied and installed python-
Hi,
Would anything be easier if we just always set a user-agent, and allowed you to override it?
Ie, we'd just define USER_AGENT somewhere and use that as the default everywhere, and always pass USER_AGENT.