Skip to content

Commit

Permalink
policy.pp : Fix duplicate ressource issue openstacklib::policy
Browse files Browse the repository at this point in the history
Currently, in the policy.pp file the class openstacklib::policy
is called. The same apply for all components resulting in a
Duplicate Ressource issue. Using directly the underlying ressource
openstacklib::policy::base we prevent this issue.

Change-Id: I7c71e957fbae4caa7a4fc3309c58a0abd057e412
  • Loading branch information
Spredzy committed Nov 10, 2014
1 parent 340abcd commit 663b4b1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions manifests/policy.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@
$policy_path = '/etc/neutron/policy.json',
) {

validate_hash($policies)

Openstacklib::Policy::Base {
file_path => $policy_path,
}
class { 'openstacklib::policy' :
policies => $policies,
}

create_resources('openstacklib::policy::base', $policies)

}
5 changes: 3 additions & 2 deletions spec/classes/neutron_policy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
end

it 'set up the policies' do
should contain_class('openstacklib::policy').with({
:policies => params[:policies]
should contain_openstacklib__policy__base('context_is_admin').with({
:key => 'context_is_admin',
:value => 'foo:bar'
})
end
end
Expand Down

0 comments on commit 663b4b1

Please sign in to comment.