From daa3c1269f29ecb7aac47f77e41c3ee8b082e15f Mon Sep 17 00:00:00 2001 From: Carlos Goncalves Date: Mon, 29 Jun 2020 20:43:33 +0200 Subject: [PATCH] Switch oslo.policy over to yaml Upstream switched oslo.policy from JSON to YAML format output in [1]. [1] https://review.opendev.org/#/c/732453/ Closes-Bug: #1885602 Depends-On: Iec610053a9250cb78c2a17bfc2c197bf55d9df86 Change-Id: Ieb6bc60eb2750a9f3f0539c2bd0176fabfebb30e --- manifests/policy.pp | 13 +++++++------ ...change-oslo-policy-to-yaml-e4efbaeafa2fbb1c.yaml | 3 +++ spec/classes/octavia_policy_spec.rb | 13 +++++++------ 3 files changed, 17 insertions(+), 12 deletions(-) create mode 100644 releasenotes/notes/change-oslo-policy-to-yaml-e4efbaeafa2fbb1c.yaml diff --git a/manifests/policy.pp b/manifests/policy.pp index 80ce0ef2..a86d6353 100644 --- a/manifests/policy.pp +++ b/manifests/policy.pp @@ -20,12 +20,12 @@ # Defaults to empty hash. # # [*policy_path*] -# (Optional) Path to the nova policy.json file -# Defaults to /etc/octavia/policy.json +# (Optional) Path to the octavia policy.yaml file +# Defaults to /etc/octavia/policy.yaml # class octavia::policy ( $policies = {}, - $policy_path = '/etc/octavia/policy.json', + $policy_path = '/etc/octavia/policy.yaml', ) { include octavia::deps @@ -34,9 +34,10 @@ class octavia::policy ( validate_legacy(Hash, 'validate_hash', $policies) Openstacklib::Policy::Base { - file_path => $policy_path, - file_user => 'root', - file_group => $::octavia::params::group, + file_path => $policy_path, + file_user => 'root', + file_group => $::octavia::params::group, + file_format => 'yaml', } create_resources('openstacklib::policy::base', $policies) diff --git a/releasenotes/notes/change-oslo-policy-to-yaml-e4efbaeafa2fbb1c.yaml b/releasenotes/notes/change-oslo-policy-to-yaml-e4efbaeafa2fbb1c.yaml new file mode 100644 index 00000000..9c9f2ed8 --- /dev/null +++ b/releasenotes/notes/change-oslo-policy-to-yaml-e4efbaeafa2fbb1c.yaml @@ -0,0 +1,3 @@ +--- +fixes: + - Octavia switched oslo.policy from JSON to YAML format output. diff --git a/spec/classes/octavia_policy_spec.rb b/spec/classes/octavia_policy_spec.rb index 2896f446..4f8d172a 100644 --- a/spec/classes/octavia_policy_spec.rb +++ b/spec/classes/octavia_policy_spec.rb @@ -5,7 +5,7 @@ describe 'octavia::policy' do shared_examples_for 'octavia policies' do let :params do { - :policy_path => '/etc/octavia/policy.json', + :policy_path => '/etc/octavia/policy.yaml', :policies => { 'context_is_admin' => { 'key' => 'context_is_admin', @@ -17,13 +17,14 @@ describe 'octavia::policy' do it 'set up the policies' do is_expected.to contain_openstacklib__policy__base('context_is_admin').with({ - :key => 'context_is_admin', - :value => 'foo:bar', - :file_user => 'root', - :file_group => 'octavia', + :key => 'context_is_admin', + :value => 'foo:bar', + :file_user => 'root', + :file_group => 'octavia', + :file_format => 'yaml', }) is_expected.to contain_oslo__policy('octavia_config').with( - :policy_file => '/etc/octavia/policy.json', + :policy_file => '/etc/octavia/policy.yaml', ) end end