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
(cherry picked from commit 624f522e71)
This commit is contained in:
Emilien Macchi 2016-02-29 12:55:22 -05:00
parent 5160235bf1
commit ee9e375116
2 changed files with 12 additions and 1 deletions

View File

@ -310,9 +310,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

@ -374,6 +374,16 @@ describe 'glance::api' do
end
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