From b3e51f06d03a888f6301bdf009ce9beb11de515f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Sat, 18 Nov 2023 17:59:19 -1000 Subject: [PATCH] Fix calling function empty() with Numeric value This produce a warning: ``` 2023-11-19T05:33:05.421+02:00 WARN [qtp925335889-44] [puppetserver] Puppet Calling function empty() with Numeric value is deprecated. (file: /usr/local/etc/puppet/code/environments/production/modules/dns/manifests/logging/channel.pp, line: 61) ``` Since we have data-types in place (`Optional[Integer]`), we do not need to care about an empty String. Only `undef` will evaluate to false, and it is the precise case we want to raise an error for. --- manifests/logging/channel.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/logging/channel.pp b/manifests/logging/channel.pp index 0c535a1c..f1386686 100644 --- a/manifests/logging/channel.pp +++ b/manifests/logging/channel.pp @@ -58,7 +58,7 @@ if empty($file_size) { fail('dns::logging::channel: "file_size" needs to be set with log type file') } - if empty($file_versions) { + if !$file_versions { fail('dns::logging::channel: "file_versions" needs to be set with log type file') } }