Merge lp:~jml/lp-dev-utils/public-ip into lp:lp-dev-utils
| Status: | Merged |
|---|---|
| Approved by: | Aaron Bentley on 2012-05-02 |
| Approved revision: | 112 |
| Merged at revision: | 111 |
| Proposed branch: | lp:~jml/lp-dev-utils/public-ip |
| Merge into: | lp:lp-dev-utils |
| Diff against target: |
233 lines (+41/-21) 4 files modified
ec2test/account.py (+13/-8) ec2test/builtins.py (+21/-8) ec2test/instance.py (+6/-4) ec2test/tests/test_ec2instance.py (+1/-1) |
| To merge this branch: | bzr merge lp:~jml/lp-dev-utils/public-ip |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Aaron Bentley (community) | 2012-05-01 | Approve on 2012-05-02 | |
|
Review via email:
|
|||
Description of the Change
When using the 'ec2' tool behind a transparent proxy, such as is running at Canonical's Millbank offices, it will fail with an odd error:
SSHException: Error reading SSH protocol banner
See http://
This is because Amazon's checkip service is honouring the X-Forwarded-For HTTP header. Since the IP being forwarded for is internal, checkip returns the internal IP, and then ec2test grants that internal IP ssh access, which means we don't get SSH access and so can't complete setting up the instance.
This branch solves the problem in two ways:
1. Use whatismyip.
2. Allow users to specify a --public-ip option to override that behaviour
Particular thanks to cjwatson who diagnosed this bug and told me how to fix it.
