vault: fix formatting of IP addresses to support IPv6

At present an invalid URL to Vault will be produced in the event
of the IP address used being an IPv6 address.
This commit is contained in:
Frode Nordahl
2020-06-06 14:40:06 +02:00
parent 2e6a2ef534
commit 37311df9c2
+2 -1
View File
@@ -27,6 +27,7 @@ import yaml
import collections
import zaza.model
import zaza.openstack.charm_tests.test_utils as test_utils
AUTH_FILE = "vault_tests.yaml"
CharmVaultClient = collections.namedtuple(
@@ -101,7 +102,7 @@ def get_unit_api_url(ip):
transport = 'http'
if vault_config['ssl-cert']['value']:
transport = 'https'
return '{}://{}:8200'.format(transport, ip)
return '{}://{}:8200'.format(transport, test_utils.format_addr(ip))
def get_hvac_client(vault_url, cacert=None):