rapi.client, http.client: Format url correctly when using IPv6
This patch moves the FormatAddress helper function from daemon.py to netutils.py. This enables its use in http.client as well as in rapi.client. Furthermore this adds functionality to format IPv6 addresses according to RFC 3986. It is required for use of literal IPv6 addresses in URLs in pycurl. For some reason it worked also without the bracketing ("["<address>"]"), but we do not want to rely on that. Signed-off-by:Manuel Franceschini <livewire@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
Showing
- lib/daemon.py 3 additions, 20 deletionslib/daemon.py
- lib/http/client.py 7 additions, 1 deletionlib/http/client.py
- lib/netutils.py 26 additions, 0 deletionslib/netutils.py
- lib/rapi/client.py 8 additions, 1 deletionlib/rapi/client.py
- test/ganeti.netutils_unittest.py 30 additions, 0 deletionstest/ganeti.netutils_unittest.py
Loading
Please register or sign in to comment