Browse Source

Merge "Allow to configure policy_dirs"

changes/37/785237/1
Zuul 2 weeks ago
committed by Gerrit Code Review
parent
commit
620df2f563
3 changed files with 16 additions and 1 deletions
  1. +9
    -1
      manifests/policy.pp
  2. +5
    -0
      releasenotes/notes/policy-dirs-3a09b80e991f9745.yaml
  3. +2
    -0
      spec/classes/gnocchi_policy_spec.rb

+ 9
- 1
manifests/policy.pp View File

@ -23,9 +23,14 @@
# (Optional) Path to the nova policy.yaml file
# Defaults to /etc/gnocchi/policy.yaml
#
# [*policy_dirs*]
# (Optional) Path to the gnocchi policy folder
# Defaults to $::os_service_default
#
class gnocchi::policy (
$policies = {},
$policy_path = '/etc/gnocchi/policy.yaml',
$policy_dirs = $::os_service_default,
) {
include gnocchi::deps
@ -53,6 +58,9 @@ class gnocchi::policy (
create_resources('openstacklib::policy::base', $policies)
oslo::policy { 'gnocchi_config': policy_file => $policy_path }
oslo::policy { 'gnocchi_config':
policy_file => $policy_path,
policy_dirs => $policy_dirs,
}
}

+ 5
- 0
releasenotes/notes/policy-dirs-3a09b80e991f9745.yaml View File

@ -0,0 +1,5 @@
---
features:
- |
There is now a new policy_dirs parameter in the gnocchi::policy class,
so one can set a custom path.

+ 2
- 0
spec/classes/gnocchi_policy_spec.rb View File

@ -6,6 +6,7 @@ describe 'gnocchi::policy' do
let :params do
{
:policy_path => '/etc/gnocchi/policy.yaml',
:policy_dirs => '/etc/gnocchi/policy.d',
:policies => {
'context_is_admin' => {
'key' => 'context_is_admin',
@ -25,6 +26,7 @@ describe 'gnocchi::policy' do
})
is_expected.to contain_oslo__policy('gnocchi_config').with(
:policy_file => '/etc/gnocchi/policy.yaml',
:policy_dirs => '/etc/gnocchi/policy.d',
)
end
end


Loading…
Cancel
Save