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: I96df810db8c14e564baca508b7d2eec71c6573c3
  • Loading branch information
Spredzy committed Nov 10, 2014
1 parent c24fe25 commit fd34b59
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/heat/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/heat_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 fd34b59

Please sign in to comment.