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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user