Skip to content

Commit

Permalink
Fix strict_variables = true
Browse files Browse the repository at this point in the history
  • Loading branch information
bobtfish committed Sep 22, 2014
1 parent b347cc8 commit 032f93a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lib/puppet/parser/functions/getvar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ module Puppet::Parser::Functions
raise Puppet::ParseError, ("getvar(): wrong number of arguments (#{args.length}; must be 1)")
end

self.lookupvar("#{args[0]}")
begin
self.lookupvar("#{args[0]}")
rescue Puppet::ParseError # Eat the exception if strict_variables = true is set
end

end

Expand Down
7 changes: 6 additions & 1 deletion lib/puppet/parser/functions/has_interface_with.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ module Puppet::Parser::Functions

result = false
interfaces.each do |iface|
if value == lookupvar("#{kind}_#{iface}")
factval = nil
begin
factval = lookupvar("#{kind}_#{iface}")
rescue Puppet::ParseError # Eat the exception if strict_variables = true is set
end
if value == factval
result = true
break
end
Expand Down

0 comments on commit 032f93a

Please sign in to comment.