Allow to configure policy_dirs
This patch makes it possible to override the current service default, which is /etc/<service>/policy.d . Change-Id: I8fca6a81cc2863c0b018f9562867f9967327a3e7
This commit is contained in:
parent
8e623875b6
commit
d2a96da170
|
@ -23,9 +23,14 @@
|
||||||
# (Optional) Path to the nova policy.yaml file
|
# (Optional) Path to the nova policy.yaml file
|
||||||
# Defaults to /etc/gnocchi/policy.yaml
|
# Defaults to /etc/gnocchi/policy.yaml
|
||||||
#
|
#
|
||||||
|
# [*policy_dirs*]
|
||||||
|
# (Optional) Path to the gnocchi policy folder
|
||||||
|
# Defaults to $::os_service_default
|
||||||
|
#
|
||||||
class gnocchi::policy (
|
class gnocchi::policy (
|
||||||
$policies = {},
|
$policies = {},
|
||||||
$policy_path = '/etc/gnocchi/policy.yaml',
|
$policy_path = '/etc/gnocchi/policy.yaml',
|
||||||
|
$policy_dirs = $::os_service_default,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
include gnocchi::deps
|
include gnocchi::deps
|
||||||
|
@ -53,6 +58,9 @@ class gnocchi::policy (
|
||||||
|
|
||||||
create_resources('openstacklib::policy::base', $policies)
|
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,
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.
|
|
@ -6,6 +6,7 @@ describe 'gnocchi::policy' do
|
||||||
let :params do
|
let :params do
|
||||||
{
|
{
|
||||||
:policy_path => '/etc/gnocchi/policy.yaml',
|
:policy_path => '/etc/gnocchi/policy.yaml',
|
||||||
|
:policy_dirs => '/etc/gnocchi/policy.d',
|
||||||
:policies => {
|
:policies => {
|
||||||
'context_is_admin' => {
|
'context_is_admin' => {
|
||||||
'key' => 'context_is_admin',
|
'key' => 'context_is_admin',
|
||||||
|
@ -25,6 +26,7 @@ describe 'gnocchi::policy' do
|
||||||
})
|
})
|
||||||
is_expected.to contain_oslo__policy('gnocchi_config').with(
|
is_expected.to contain_oslo__policy('gnocchi_config').with(
|
||||||
:policy_file => '/etc/gnocchi/policy.yaml',
|
:policy_file => '/etc/gnocchi/policy.yaml',
|
||||||
|
:policy_dirs => '/etc/gnocchi/policy.d',
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue