Import base parameter types for ::policy

Import the parameter types from openstacklib::policy so that parameter
types are validated at module level, instead of internal resource
call.

Also remove the tag which is no longer necessary after dependency
refactoring.

Change-Id: I3b762e4a0eb044c2995e4a5963a8ed3da2cb54c0
Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
This commit is contained in:
Takashi Kajinami
2025-09-27 23:48:49 +09:00
parent aff2408709
commit 8eee578c4e
2 changed files with 7 additions and 10 deletions

View File

@@ -46,13 +46,13 @@
# Defaults to false.
#
class watcher::policy (
$enforce_scope = $facts['os_service_default'],
$enforce_new_defaults = $facts['os_service_default'],
Hash $policies = {},
$policy_path = '/etc/watcher/policy.yaml',
$policy_default_rule = $facts['os_service_default'],
$policy_dirs = $facts['os_service_default'],
Boolean $purge_config = false,
$enforce_scope = $facts['os_service_default'],
$enforce_new_defaults = $facts['os_service_default'],
Openstacklib::Policies $policies = {},
Stdlib::Absolutepath $policy_path = '/etc/watcher/policy.yaml',
$policy_default_rule = $facts['os_service_default'],
$policy_dirs = $facts['os_service_default'],
Boolean $purge_config = false,
) {
include watcher::deps
include watcher::params
@@ -64,7 +64,6 @@ class watcher::policy (
file_group => $watcher::params::group,
file_format => 'yaml',
purge_config => $purge_config,
tag => 'watcher',
}
create_resources('openstacklib::policy', { $policy_path => $policy_parameters })

View File

@@ -33,7 +33,6 @@ describe 'watcher::policy' do
:file_group => 'watcher',
:file_format => 'yaml',
:purge_config => false,
:tag => 'watcher',
)
is_expected.to contain_oslo__policy('watcher_config').with(
:enforce_scope => false,
@@ -64,7 +63,6 @@ describe 'watcher::policy' do
:file_group => 'watcher',
:file_format => 'yaml',
:purge_config => true,
:tag => 'watcher',
)
is_expected.to contain_oslo__policy('watcher_config').with(
:enforce_scope => false,