Merge "Add support for the oslo_policy/enforce_scope parameter"
This commit is contained in:
commit
705447d107
@ -4,6 +4,10 @@
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*enforce_scope*]
|
||||
# (Optional) Whether or not to enforce scope when evaluating policies.
|
||||
# Defaults to $::os_service_default.
|
||||
#
|
||||
# [*policies*]
|
||||
# (Optional) Set of policies to configure for aodh
|
||||
# Example :
|
||||
@ -20,10 +24,11 @@
|
||||
# Defaults to empty hash.
|
||||
#
|
||||
# [*policy_path*]
|
||||
# (Optional) Path to the nova policy.yaml file
|
||||
# (Optional) Path to the aodh policy.yaml file
|
||||
# Defaults to /etc/aodh/policy.yaml
|
||||
#
|
||||
class aodh::policy (
|
||||
$enforce_scope = $::os_service_default,
|
||||
$policies = {},
|
||||
$policy_path = '/etc/aodh/policy.yaml',
|
||||
) {
|
||||
@ -42,6 +47,9 @@ class aodh::policy (
|
||||
|
||||
create_resources('openstacklib::policy::base', $policies)
|
||||
|
||||
oslo::policy { 'aodh_config': policy_file => $policy_path }
|
||||
oslo::policy { 'aodh_config':
|
||||
enforce_scope => $enforce_scope,
|
||||
policy_file => $policy_path
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,5 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
The new ``aodh::policy::enforce_scope`` parameter has been added to
|
||||
support the corresponding parameter in oslo.policy library.
|
@ -1,10 +1,10 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'aodh::policy' do
|
||||
|
||||
shared_examples_for 'aodh policies' do
|
||||
shared_examples 'aodh::policy' do
|
||||
let :params do
|
||||
{
|
||||
:enforce_scope => false,
|
||||
:policy_path => '/etc/aodh/policy.yaml',
|
||||
:policies => {
|
||||
'context_is_admin' => {
|
||||
@ -24,6 +24,7 @@ describe 'aodh::policy' do
|
||||
:file_format => 'yaml',
|
||||
})
|
||||
is_expected.to contain_oslo__policy('aodh_config').with(
|
||||
:enforce_scope => false,
|
||||
:policy_file => '/etc/aodh/policy.yaml',
|
||||
)
|
||||
end
|
||||
@ -37,7 +38,7 @@ describe 'aodh::policy' do
|
||||
facts.merge!(OSDefaults.get_facts())
|
||||
end
|
||||
|
||||
it_configures 'aodh policies'
|
||||
it_behaves_like 'aodh::policy'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user