Change bind address to use Identity endpoint host

Allow the bind interface address to take precendence, but default
to binding to the host attribute of the Identity API endpoint.
This brings the identity cookbook into conformance with the
other cookbooks regarding the service interface binding.

Closes-Bug: 1277266

Change-Id: I9634e2a359a6ce52b694859a7e84a57638bad5be
This commit is contained in:
Matt Odden
2014-02-07 02:19:52 +00:00
committed by galstrom21
parent 1cf0440d63
commit e94c69b56c
5 changed files with 30 additions and 10 deletions

View File

@@ -179,9 +179,25 @@ describe 'openstack-identity::server' do
expect(chef_run).to render_file(path).with_content(r)
end
it 'has bind host' do
r = line_regexp('bind_host = 127.0.1.1')
expect(chef_run).to render_file(path).with_content(r)
describe 'bind_interface is nil' do
it 'has bind host from endpoint' do
r = line_regexp('bind_host = 127.0.1.1')
expect(chef_run).to render_file(path).with_content(r)
end
end
describe 'bind_interface is eth0' do
before do
node.set['openstack']['identity']['bind_interface'] = 'eth0'
::Chef::Recipe.any_instance.stub(:address_for)
.with('eth0')
.and_return('10.0.0.2')
end
it 'has bind host from interface ip' do
r = line_regexp('bind_host = 10.0.0.2')
expect(chef_run).to render_file(path).with_content(r)
end
end
describe 'port numbers' do