Add support for oslo_policy/enforce_new_defaults
Depends-on: https://review.opendev.org/781428 Change-Id: I0e6cfc05eb948cdfbb6433b8b6311292ea96d35e
This commit is contained in:
parent
77fb34e43e
commit
8591466c66
@ -8,6 +8,11 @@
|
||||
# (Optional) Whether or not to enforce scope when evaluating policies.
|
||||
# Defaults to $::os_service_default.
|
||||
#
|
||||
# [*enforce_new_defaults*]
|
||||
# (Optional) Whether or not to use old deprecated defaults when evaluating
|
||||
# policies.
|
||||
# Defaults to $::os_service_default.
|
||||
#
|
||||
# [*policies*]
|
||||
# (Optional) Set of policies to configure for trove
|
||||
# Example :
|
||||
@ -28,9 +33,10 @@
|
||||
# Defaults to /etc/trove/policy.yaml
|
||||
#
|
||||
class trove::policy (
|
||||
$enforce_scope = $::os_service_default,
|
||||
$policies = {},
|
||||
$policy_path = '/etc/trove/policy.yaml',
|
||||
$enforce_scope = $::os_service_default,
|
||||
$enforce_new_defaults = $::os_service_default,
|
||||
$policies = {},
|
||||
$policy_path = '/etc/trove/policy.yaml',
|
||||
) {
|
||||
|
||||
include trove::deps
|
||||
@ -48,8 +54,9 @@ class trove::policy (
|
||||
create_resources('openstacklib::policy::base', $policies)
|
||||
|
||||
oslo::policy { 'trove_config':
|
||||
enforce_scope => $enforce_scope,
|
||||
policy_file => $policy_path
|
||||
enforce_scope => $enforce_scope,
|
||||
enforce_new_defaults => $enforce_new_defaults,
|
||||
policy_file => $policy_path
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,5 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
The new ``trove::policy::enforce_new_defaults`` parameter has been
|
||||
added.
|
@ -4,9 +4,10 @@ describe 'trove::policy' do
|
||||
shared_examples 'trove::policy' do
|
||||
let :params do
|
||||
{
|
||||
:enforce_scope => false,
|
||||
:policy_path => '/etc/trove/policy.yaml',
|
||||
:policies => {
|
||||
:enforce_scope => false,
|
||||
:enforce_new_defaults => false,
|
||||
:policy_path => '/etc/trove/policy.yaml',
|
||||
:policies => {
|
||||
'context_is_admin' => {
|
||||
'key' => 'context_is_admin',
|
||||
'value' => 'foo:bar'
|
||||
@ -24,8 +25,9 @@ describe 'trove::policy' do
|
||||
:file_format => 'yaml',
|
||||
})
|
||||
is_expected.to contain_oslo__policy('trove_config').with(
|
||||
:enforce_scope => false,
|
||||
:policy_file => '/etc/trove/policy.yaml',
|
||||
:enforce_scope => false,
|
||||
:enforce_new_defaults => false,
|
||||
:policy_file => '/etc/trove/policy.yaml',
|
||||
)
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user