Allow to configure policy_dirs
This patch makes it possible to override the current service default, which is /etc/<service>/policy.d . Change-Id: I1a6615fc61ee454bd4472cb671e7a6ff37a077ac
This commit is contained in:
parent
2e69413050
commit
1682bb7a51
@ -32,11 +32,16 @@
|
|||||||
# (Optional) Path to the neutron policy.yaml file
|
# (Optional) Path to the neutron policy.yaml file
|
||||||
# Defaults to /etc/neutron/policy.yaml
|
# Defaults to /etc/neutron/policy.yaml
|
||||||
#
|
#
|
||||||
|
# [*policy_dirs*]
|
||||||
|
# (Optional) Path to the neutron policy folder
|
||||||
|
# Defaults to $::os_service_default
|
||||||
|
#
|
||||||
class neutron::policy (
|
class neutron::policy (
|
||||||
$enforce_scope = $::os_service_default,
|
$enforce_scope = $::os_service_default,
|
||||||
$enforce_new_defaults = $::os_service_default,
|
$enforce_new_defaults = $::os_service_default,
|
||||||
$policies = {},
|
$policies = {},
|
||||||
$policy_path = '/etc/neutron/policy.yaml',
|
$policy_path = '/etc/neutron/policy.yaml',
|
||||||
|
$policy_dirs = $::os_service_default,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
include neutron::deps
|
include neutron::deps
|
||||||
@ -56,7 +61,8 @@ class neutron::policy (
|
|||||||
oslo::policy { 'neutron_config':
|
oslo::policy { 'neutron_config':
|
||||||
enforce_scope => $enforce_scope,
|
enforce_scope => $enforce_scope,
|
||||||
enforce_new_defaults => $enforce_new_defaults,
|
enforce_new_defaults => $enforce_new_defaults,
|
||||||
policy_file => $policy_path
|
policy_file => $policy_path,
|
||||||
|
policy_dirs => $policy_dirs,
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
5
releasenotes/notes/policy-dirs-dcb8fc38f3342035.yaml
Normal file
5
releasenotes/notes/policy-dirs-dcb8fc38f3342035.yaml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
There is now a new policy_dirs parameter in the neutron::policy class,
|
||||||
|
so one can set a custom path.
|
@ -7,6 +7,7 @@ describe 'neutron::policy' do
|
|||||||
:enforce_scope => false,
|
:enforce_scope => false,
|
||||||
:enforce_new_defaults => false,
|
:enforce_new_defaults => false,
|
||||||
:policy_path => '/etc/neutron/policy.yaml',
|
:policy_path => '/etc/neutron/policy.yaml',
|
||||||
|
:policy_dirs => '/etc/neutron/policy.d',
|
||||||
:policies => {
|
:policies => {
|
||||||
'context_is_admin' => {
|
'context_is_admin' => {
|
||||||
'key' => 'context_is_admin',
|
'key' => 'context_is_admin',
|
||||||
@ -28,6 +29,7 @@ describe 'neutron::policy' do
|
|||||||
:enforce_scope => false,
|
:enforce_scope => false,
|
||||||
:enforce_new_defaults => false,
|
:enforce_new_defaults => false,
|
||||||
:policy_file => '/etc/neutron/policy.yaml',
|
:policy_file => '/etc/neutron/policy.yaml',
|
||||||
|
:policy_dirs => '/etc/neutron/policy.d',
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user