diff --git a/manifests/policy.pp b/manifests/policy.pp index 8907e8fe..322dd0da 100644 --- a/manifests/policy.pp +++ b/manifests/policy.pp @@ -18,11 +18,12 @@ class cinder::policy ( $policy_path = '/etc/cinder/policy.json', ) { + validate_hash($policies) + Openstacklib::Policy::Base { file_path => $policy_path, } - class { 'openstacklib::policy' : - policies => $policies, - } + + create_resources('openstacklib::policy::base', $policies) } diff --git a/spec/classes/cinder_policy_spec.rb b/spec/classes/cinder_policy_spec.rb index 409a7279..e9b6d46d 100644 --- a/spec/classes/cinder_policy_spec.rb +++ b/spec/classes/cinder_policy_spec.rb @@ -16,8 +16,9 @@ describe 'cinder::policy' do 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