Skip to content

Commit 663b4b1

Browse files
committed
policy.pp : Fix duplicate ressource issue openstacklib::policy
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
1 parent 340abcd commit 663b4b1

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

manifests/policy.pp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@
1818
$policy_path = '/etc/neutron/policy.json',
1919
) {
2020

21+
validate_hash($policies)
22+
2123
Openstacklib::Policy::Base {
2224
file_path => $policy_path,
2325
}
24-
class { 'openstacklib::policy' :
25-
policies => $policies,
26-
}
26+
27+
create_resources('openstacklib::policy::base', $policies)
2728

2829
}

spec/classes/neutron_policy_spec.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
end
1717

1818
it 'set up the policies' do
19-
should contain_class('openstacklib::policy').with({
20-
:policies => params[:policies]
19+
should contain_openstacklib__policy__base('context_is_admin').with({
20+
:key => 'context_is_admin',
21+
:value => 'foo:bar'
2122
})
2223
end
2324
end

0 commit comments

Comments
 (0)