Remove param validation if enable_ovs_agent=false

Currently the controller module assumes that the
OVS agent is always configured when the neutron
service is configured. This patch ensures that
when OVS agent is not enabled, we do not require
OVS agent specific params to be set.

Change-Id: Id3e601841f2c962dbe9a142c4bdfe80b1a9fd4a7
This commit is contained in:
Sumit Naiksatam 2014-01-23 16:42:00 -08:00
parent 1bd3442a94
commit d3928e578d
2 changed files with 33 additions and 11 deletions

View File

@ -504,20 +504,22 @@ class openstack::controller (
fail('neutron_db_password must be set when configuring neutron')
}
if ! $bridge_interface {
fail('bridge_interface must be set when configuring neutron')
}
if $enable_ovs_agent {
if ! $bridge_interface {
fail('bridge_interface must be set when configuring neutron')
}
if ! $bridge_uplinks {
$bridge_uplinks_real = ["${external_bridge_name}:${bridge_interface}"]
} else {
if ! $bridge_uplinks {
$bridge_uplinks_real = ["${external_bridge_name}:${bridge_interface}"]
} else {
$bridge_uplinks_real = $bridge_uplinks
}
}
if ! $bridge_mappings {
$bridge_mappings_real = ["${physical_network}:${external_bridge_name}"]
} else {
$bridge_mappings_real = $bridge_mappings
if ! $bridge_mappings {
$bridge_mappings_real = ["${physical_network}:${external_bridge_name}"]
} else {
$bridge_mappings_real = $bridge_mappings
}
}
class { 'openstack::neutron':

View File

@ -814,6 +814,26 @@ describe 'openstack::controller' do
})
end
context 'when ovs is not enabled' do
let :params do
default_params.merge({
:enable_ovs_agent => false,
:neutron => true,
:neutron_user_password => 'q_pass',
:allow_overlapping_ips => false,
:internal_address => '10.0.0.3',
:neutron_db_password => 'q_db_pass',
:metadata_shared_secret => 'secret',
:external_bridge_name => 'br-ex'
})
end
it 'should not fail when required ovs parameters are not set' do
should contain_class('openstack::controller')
end
end
it { should_not contain_class('nova::network') }
it { should contain_class('nova::network::neutron').with(:security_group_api => 'neutron') }