Delete policy file if policies hash is empty
If all policies get deleted, previously created policy files won't get removed and the api policy file is still is used. Lets remove the policy file if the policies hash is empty. Change-Id: Ic9b5ccd8fc23f6cebc06f62d972b64efd2400396
This commit is contained in:
parent
212ac22431
commit
58af07ac06
|
@ -49,14 +49,21 @@ class nova::policy (
|
|||
|
||||
validate_legacy(Hash, 'validate_hash', $policies)
|
||||
|
||||
Openstacklib::Policy::Base {
|
||||
file_path => $policy_path,
|
||||
file_user => 'root',
|
||||
file_group => $::nova::params::group,
|
||||
file_format => 'yaml',
|
||||
}
|
||||
if empty($policies){
|
||||
file {$policy_path:
|
||||
path => $policy_path,
|
||||
ensure => absent,
|
||||
}
|
||||
} else {
|
||||
Openstacklib::Policy::Base {
|
||||
file_path => $policy_path,
|
||||
file_user => 'root',
|
||||
file_group => $::nova::params::group,
|
||||
file_format => 'yaml',
|
||||
}
|
||||
|
||||
create_resources('openstacklib::policy::base', $policies)
|
||||
create_resources('openstacklib::policy::base', $policies)
|
||||
}
|
||||
|
||||
oslo::policy { 'nova_config':
|
||||
enforce_scope => $enforce_scope,
|
||||
|
|
Loading…
Reference in New Issue