From: Peter Palfrader Date: Tue, 15 Oct 2019 11:01:10 +0000 (+0200) Subject: Catch empty data arrays at start of entropy_provider function X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=3de5917dacf8547cb4ddf7c563516d8132b47472;p=mirror%2Fdsa-puppet.git Catch empty data arrays at start of entropy_provider function --- diff --git a/modules/puppetmaster/lib/puppet/parser/functions/entropy_provider.rb b/modules/puppetmaster/lib/puppet/parser/functions/entropy_provider.rb index 5c8c6fe02..32c413f16 100644 --- a/modules/puppetmaster/lib/puppet/parser/functions/entropy_provider.rb +++ b/modules/puppetmaster/lib/puppet/parser/functions/entropy_provider.rb @@ -10,9 +10,9 @@ module Puppet::Parser::Functions allnodeinfo = lookupvar('deprecated::allnodeinfo') raise Puppet::ParseError, "entropy_provider: Cannot learn fqdn" unless fqdn - raise Puppet::ParseError, "entropy_provider: Cannot learn nodeinfo" unless nodeinfo - raise Puppet::ParseError, "entropy_provider: Cannot learn localinfo" unless localinfo - raise Puppet::ParseError, "entropy_provider: Cannot learn allnodeinfo" unless allnodeinfo + raise Puppet::ParseError, "entropy_provider: Cannot learn nodeinfo" unless nodeinfo and nodeinfo.size > 0 + raise Puppet::ParseError, "entropy_provider: Cannot learn localinfo" unless localinfo and localinfo.size > 0 + raise Puppet::ParseError, "entropy_provider: Cannot learn allnodeinfo" unless allnodeinfo and allnodeinfo.size > 0 # find where all the entropy keys are provider = []