Added check to ensure that given fact name is a string.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
This commit is contained in:
Krzysztof Wilczynski 2011-04-29 20:58:28 +01:00
parent b24c839f89
commit 8454622e32

View file

@ -12,6 +12,10 @@ module Puppet::Parser::Functions
fact = arguments[0]
if not fact.is_a?(String)
raise(Puppet::ParseError, 'fact(): Requires fact name to be a string')
end
raise(Puppet::ParseError, 'fact(): You must provide ' +
'fact name') if fact.empty?