summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHunter Haugen <hunter@puppetlabs.com>2015-07-09 10:20:01 -0700
committerHunter Haugen <hunter@puppetlabs.com>2015-07-09 10:20:01 -0700
commitb2aed66226b4fe33fe24252eab7a6e64a4a03ddd (patch)
treec0a07a514411edec2b62cdb2e17dc25bc202ecdd
parentf820bb156038f638d8e488286d0c2b92c5636925 (diff)
parente96a818782c944b4b1af5417d0bcffc08e95aadc (diff)
downloadpuppet-stdlib-b2aed66226b4fe33fe24252eab7a6e64a4a03ddd.tar.gz
puppet-stdlib-b2aed66226b4fe33fe24252eab7a6e64a4a03ddd.tar.bz2
Merge pull request #479 from mklette/master
catch and rescue from looking up non-existent facts
-rw-r--r--lib/puppet/parser/functions/has_interface_with.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/puppet/parser/functions/has_interface_with.rb b/lib/puppet/parser/functions/has_interface_with.rb
index 3691524..e762798 100644
--- a/lib/puppet/parser/functions/has_interface_with.rb
+++ b/lib/puppet/parser/functions/has_interface_with.rb
@@ -38,8 +38,11 @@ has_interface_with("lo") => true
# Bug with 3.7.1 - 3.7.3 when using future parser throws :undefined_variable
# https://tickets.puppetlabs.com/browse/PUP-3597
factval = nil
- catch :undefined_variable do
- factval = lookupvar(kind)
+ begin
+ catch :undefined_variable do
+ factval = lookupvar(kind)
+ end
+ rescue Puppet::ParseError # Eat the exception if strict_variables = true is set
end
if factval == value
return true