Emilien Macchi 31b3465159 configure_horizon: allow to parse ipv6 url
First of all, 'configure_horizon' function has a bad assumption that
Horizon host is the same as Keystone host.
But this patch won't fix it.

The function was parsing the url without properly using urllib.
Using netloc allows to get the actual host + port, and then we can
remove the port part to build the horizon URL.
That way, IPv6 hosts can be parsed, with brackets.

In the future, we should make configure_horizon function working with
external horizon hosts but it's unrelated to this ipv6 issue.

Also, this patch adds unit tests so we now make sure both ipv4 and ipv6
can be used to configure horizon URL.

Change-Id: I93530db89a0f8ac2bd5c10ae38e6b61e318a7c87
2017-12-01 19:42:34 -08:00
..