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:
parent
b24c839f89
commit
8454622e32
1 changed files with 4 additions and 0 deletions
4
fact.rb
4
fact.rb
|
@ -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?
|
||||
|
||||
|
|
Loading…
Reference in a new issue