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:
Dan Bode
2012-05-24 16:58:50 -07:00
parent 65c0609ee9
commit 62009227be
2 changed files with 57 additions and 1 deletions

View File

@@ -18,7 +18,7 @@ define nova::manage::network (
ensure => present,
network => $network,
num_networks => $num_networks,
project => undef,
project => $project,
notify => Exec['nova-db-sync'],
}

View 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