Supports IPv6 in registry_host

This patch add support for IPv6 address in registry_host.
It adds brackets if an IPv6 is detected.

Change-Id: Ic1d75984fac7bce3d0239df54a877ae2b713c442
This commit is contained in:
Emilien Macchi 2016-02-29 12:55:22 -05:00
parent b3160011aa
commit 624f522e71
2 changed files with 13 additions and 1 deletions

View File

@ -354,9 +354,10 @@ class glance::api(
'glance_store/os_region_name': value => $os_region_name;
}
$registry_host_real = normalize_ip_for_uri($registry_host)
# configure api service to connect registry service
glance_api_config {
'DEFAULT/registry_host': value => $registry_host;
'DEFAULT/registry_host': value => $registry_host_real;
'DEFAULT/registry_port': value => $registry_port;
'DEFAULT/registry_client_protocol': value => $registry_client_protocol;
}

View File

@ -307,6 +307,17 @@ describe 'glance::api' do
)}
end
describe 'Support IPv6' do
let :params do
default_params.merge({
:registry_host => '2001::1',
})
end
it { is_expected.to contain_glance_api_config('DEFAULT/registry_host').with(
:value => '[2001::1]'
)}
end
describe 'on Debian platforms' do
let :facts do
@default_facts.merge({