Skip to content

Commit

Permalink
Merge "Fix network_vlan_ranges parameter for OVS plugin" into stable/…
Browse files Browse the repository at this point in the history
…havana
  • Loading branch information
Jenkins authored and openstack-gerrit committed Apr 1, 2014
2 parents 21652a6 + e1f4f23 commit fc4cb16
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
10 changes: 8 additions & 2 deletions manifests/plugins/ovs.pp
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,15 @@
} else {
# This might be set by the user for the gre or vxlan case where
# provider networks are in use
validate_network_vlan_ranges($network_vlan_ranges)
if !is_array($network_vlan_ranges) {
$arr_network_vlan_ranges = strip(split($network_vlan_ranges, ','))
} else {
$arr_network_vlan_ranges = $network_vlan_ranges
}

validate_network_vlan_ranges($arr_network_vlan_ranges)
neutron_plugin_ovs {
'OVS/network_vlan_ranges': value => $network_vlan_ranges
'OVS/network_vlan_ranges': value => join($arr_network_vlan_ranges, ',');
}
}

Expand Down
14 changes: 14 additions & 0 deletions spec/classes/neutron_plugins_ovs_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,20 @@
end
it { should contain_neutron_plugin_ovs('OVS/network_vlan_ranges').with_value(params[:network_vlan_ranges]) }
end

context 'with comma separated vlan ranges' do
let :params do
{ :network_vlan_ranges => 'physint1:1000:2000,physext1:100:200' }
end
it { should contain_neutron_plugin_ovs('OVS/network_vlan_ranges').with_value(params[:network_vlan_ranges]) }
end

context 'with vlan ranges in array' do
let :params do
{ :network_vlan_ranges => ['physint1:1000:2000', 'physext1:100:200'] }
end
it { should contain_neutron_plugin_ovs('OVS/network_vlan_ranges').with_value(params[:network_vlan_ranges].join(',')) }
end
end

context 'on Debian platforms' do
Expand Down

0 comments on commit fc4cb16

Please sign in to comment.