Use yaml instead of json for policy file
Because usage of json for policy file will be deprecated and replaced by yaml[1]. [1] https://governance.openstack.org/tc/goals/selected/wallaby/migrate-policy-format-from-json-to-yaml.html Depends-on: https://review.opendev.org/769647 Change-Id: I35c5f1e410b383e4345986a136a54088f60acda6
This commit is contained in:
parent
c87618ee07
commit
c494e85c90
@ -20,12 +20,12 @@
|
||||
# Defaults to empty hash.
|
||||
#
|
||||
# [*policy_path*]
|
||||
# (Optional) Path to the nova policy.json file
|
||||
# Defaults to /etc/freezer/policy.json
|
||||
# (Optional) Path to the nova policy.yaml file
|
||||
# Defaults to /etc/freezer/policy.yaml
|
||||
#
|
||||
class freezer::policy (
|
||||
$policies = {},
|
||||
$policy_path = '/etc/freezer/policy.json',
|
||||
$policy_path = '/etc/freezer/policy.yaml',
|
||||
) {
|
||||
|
||||
include freezer::deps
|
||||
@ -37,6 +37,7 @@ class freezer::policy (
|
||||
file_path => $policy_path,
|
||||
file_user => 'root',
|
||||
file_group => $::freezer::params::group,
|
||||
file_format => 'yaml',
|
||||
}
|
||||
|
||||
create_resources('openstacklib::policy::base', $policies)
|
||||
|
@ -0,0 +1,4 @@
|
||||
---
|
||||
upgrade:
|
||||
- |
|
||||
Now policy.yaml is used by default instead of policy.json.
|
@ -5,7 +5,7 @@ describe 'freezer::policy' do
|
||||
shared_examples_for 'freezer policies' do
|
||||
let :params do
|
||||
{
|
||||
:policy_path => '/etc/freezer/policy.json',
|
||||
:policy_path => '/etc/freezer/policy.yaml',
|
||||
:policies => {
|
||||
'context_is_admin' => {
|
||||
'key' => 'context_is_admin',
|
||||
@ -21,9 +21,10 @@ describe 'freezer::policy' do
|
||||
:value => 'foo:bar',
|
||||
:file_user => 'root',
|
||||
:file_group => 'freezer',
|
||||
:file_format => 'yaml',
|
||||
})
|
||||
is_expected.to contain_oslo__policy('freezer_config').with(
|
||||
:policy_file => '/etc/freezer/policy.json',
|
||||
:policy_file => '/etc/freezer/policy.yaml',
|
||||
)
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user