Replace legacy facts and use fact hash

... because the latest lint no longer allows usage of legacy facts and
top scope fact.

Change-Id: I8c6cbf3801edac54098f0a4de51109e6cbf03913
This commit is contained in:
Takashi Kajinami 2023-03-02 12:35:40 +09:00
parent df92712653
commit 31675bb6da
3 changed files with 7 additions and 8 deletions

View File

@ -178,14 +178,14 @@ class qdr(
$router_debug_dump = '/var/log/qdrouterd',
$router_hello_interval = '1',
$router_hello_max_age = '3',
$router_id = "Router.${::fqdn}",
$router_id = "Router.${facts['networking']['fqdn']}",
$router_mode = 'standalone',
$router_ra_interval = '30',
$router_ra_interval_flux = '4',
$router_remote_ls_max_age = '60',
$router_sasl_name = 'qdrouterd',
$router_sasl_path = '/etc/sasl2',
$router_worker_threads = $::os_workers,
$router_worker_threads = $facts['os_workers'],
) inherits qdr::params {
validate_legacy(Stdlib::Absolutepath, 'validate_absolute_path', $router_debug_dump)
@ -206,7 +206,7 @@ class qdr(
$listener_require_ssl_bool = qdr::fixTruthy($listener_require_ssl)
# TODO (ansmith) - manage repo via openstack-extras
# if $::operatingsystem == 'Ubuntu' {
# if $facts['os']['name'] == 'Ubuntu' {
# include apt
#
# Class['apt::update'] -> Package<| provider == 'apt' |>

View File

@ -4,7 +4,7 @@
#
class qdr::params {
case $::osfamily {
case $facts['os']['family'] {
'Debian': {
$service_package_name = 'qdrouterd'
$service_name = 'qdrouterd'
@ -21,7 +21,7 @@ class qdr::params {
$service_package_name = 'qpid-dispatch-router'
$service_name = 'qdrouterd'
$service_config_path = '/etc/qpid-dispatch/qdrouterd.conf'
if Integer.new($::os['release']['major']) > 7 {
if Integer.new($facts['os']['release']['major']) > 7 {
$package_provider = 'dnf'
} else {
$package_provider = 'yum'
@ -34,8 +34,7 @@ class qdr::params {
$tools_package_list = [ 'qpid-dispatch-tools' ]
}
default: {
fail("Unsupported osfamily: ${::osfamily} operatingsystem: ${::operatingsystem}, \
module ${module_name} only support osfamily RedHat and Debian")
fail("Unsupported osfamily: ${facts['os']['family']}")
}
}

View File

@ -176,7 +176,7 @@ describe 'qdr' do
}))
end
case facts[:osfamily]
case facts[:os]['family']
when 'Debian'
let (:platform_params) do
{ :qdr_package_name => 'qdrouterd',