Project should be set
Previously, a project parameter was specific in the nova::manage::network define, but it was not forwarded to the nova_network declaration. This commit fixes it, ensuring that users can associate projects to networks.
This commit is contained in:
@@ -18,7 +18,7 @@ define nova::manage::network (
|
|||||||
ensure => present,
|
ensure => present,
|
||||||
network => $network,
|
network => $network,
|
||||||
num_networks => $num_networks,
|
num_networks => $num_networks,
|
||||||
project => undef,
|
project => $project,
|
||||||
notify => Exec['nova-db-sync'],
|
notify => Exec['nova-db-sync'],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
56
spec/defines/nova_manage_networks.pp
Normal file
56
spec/defines/nova_manage_networks.pp
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe 'nova::manage::network' do
|
||||||
|
|
||||||
|
let :facts do
|
||||||
|
{:osfamily => 'RedHat'}
|
||||||
|
end
|
||||||
|
|
||||||
|
let :pre_condition do
|
||||||
|
'include nova'
|
||||||
|
end
|
||||||
|
|
||||||
|
let :title do
|
||||||
|
'foo'
|
||||||
|
end
|
||||||
|
|
||||||
|
describe 'with only required parameters' do
|
||||||
|
let :params do
|
||||||
|
{
|
||||||
|
:network => '10.0.0.0/24'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
it { should contain_nova_network('foo').with(
|
||||||
|
:ensure => 'present',
|
||||||
|
:network => '10.0.0.0/24',
|
||||||
|
:num_networks => 1,
|
||||||
|
:project => nil,
|
||||||
|
:notify => 'Exec[nova-db-sync]'
|
||||||
|
) }
|
||||||
|
end
|
||||||
|
describe 'when overriding num networks' do
|
||||||
|
let :params do
|
||||||
|
{
|
||||||
|
:network => '10.0.0.0/20',
|
||||||
|
:num_networks => 2
|
||||||
|
}
|
||||||
|
end
|
||||||
|
it { should contain_nova_network('foo').with(
|
||||||
|
:network => '10.0.0.0/20',
|
||||||
|
:num_networks => 2
|
||||||
|
) }
|
||||||
|
end
|
||||||
|
|
||||||
|
describe 'when overriding projects' do
|
||||||
|
let :params do
|
||||||
|
{
|
||||||
|
:network => '10.0.0.0/20',
|
||||||
|
:project => 'foo'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
it { should contain_nova_network('foo').with(
|
||||||
|
:network => '10.0.0.0/20',
|
||||||
|
:project => 'foo'
|
||||||
|
) }
|
||||||
|
end
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user