Skip to content

Commit

Permalink
Merge "Add ability to manage Neutron ML2 plugin package state"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins authored and openstack-gerrit committed Aug 19, 2014
2 parents 48aa3fb + 7d20fc9 commit a929c14
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
5 changes: 3 additions & 2 deletions manifests/plugins/ml2.pp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@
$tunnel_id_ranges = ['20:100'],
$vxlan_group = '224.0.0.1',
$vni_ranges = ['10:100'],
$enable_security_group = true
$enable_security_group = true,
$package_ensure = 'present'
) {

include neutron::params
Expand Down Expand Up @@ -131,7 +132,7 @@
# Some platforms do not have a dedicated ml2 plugin package
if $::neutron::params::ml2_server_package {
package { 'neutron-plugin-ml2':
ensure => present,
ensure => $package_ensure,
name => $::neutron::params::ml2_server_package,
}
Package['neutron-plugin-ml2'] -> Neutron_plugin_ml2<||>
Expand Down
19 changes: 17 additions & 2 deletions spec/classes/neutron_plugins_ml2_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
:network_vlan_ranges => ['10:50'],
:tunnel_id_ranges => ['20:100'],
:vxlan_group => '224.0.0.1',
:vni_ranges => ['10:100'] }
:vni_ranges => ['10:100'],
:package_ensure => 'present' }
end

let :params do
Expand Down Expand Up @@ -71,7 +72,7 @@
if platform_params.has_key?(:ml2_server_package)
should contain_package('neutron-plugin-ml2').with(
:name => platform_params[:ml2_server_package],
:ensure => 'present'
:ensure => p[:package_ensure]
)
should contain_package('neutron-plugin-ml2').with_before(/Neutron_plugin_ml2\[.+\]/)
end
Expand Down Expand Up @@ -167,6 +168,20 @@
expect { subject }.to raise_error(Puppet::Error, /vni ranges are invalid./)
end
end

context 'when overriding package ensure state' do
before :each do
params.merge!(:package_ensure => 'latest')
end
it 'overrides package ensure state (if possible)' do
if platform_params.has_key?(:ml2_server_package)
should contain_package('neutron-plugin-ml2').with(
:name => platform_params[:ml2_server_package],
:ensure => params[:package_ensure]
)
end
end
end
end

context 'on Debian platforms' do
Expand Down

0 comments on commit a929c14

Please sign in to comment.