Skip to content

Commit

Permalink
Fix calling function empty() with Numeric value
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
smortex committed Nov 19, 2023
1 parent 06cb242 commit b3e51f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion manifests/logging/channel.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
}
Expand Down

0 comments on commit b3e51f0

Please sign in to comment.