summaryrefslogtreecommitdiff
path: root/lib/puppet/parser/functions
diff options
context:
space:
mode:
authorHunter Haugen <hunter@puppetlabs.com>2014-11-12 11:54:41 -0800
committerHunter Haugen <hunter@puppetlabs.com>2014-11-12 11:54:41 -0800
commitb80c432ab9de2536aab099e5d5b3baf9e883bc68 (patch)
treebeaf5f625bb672bcf57cfe9e06534fb4250eba38 /lib/puppet/parser/functions
parent85d7eddc41b04c9a9a7bf1a171dd8d3ab157a88a (diff)
parentded4d516f15443ef145d64ef5e2b198578f6a190 (diff)
downloadpuppet-stdlib-b80c432ab9de2536aab099e5d5b3baf9e883bc68.tar.gz
puppet-stdlib-b80c432ab9de2536aab099e5d5b3baf9e883bc68.tar.bz2
Merge pull request #366 from mhaskel/merge_4.4.x
Merge 4.4.x
Diffstat (limited to 'lib/puppet/parser/functions')
-rw-r--r--lib/puppet/parser/functions/has_interface_with.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/puppet/parser/functions/has_interface_with.rb b/lib/puppet/parser/functions/has_interface_with.rb
index 00e405d..3691524 100644
--- a/lib/puppet/parser/functions/has_interface_with.rb
+++ b/lib/puppet/parser/functions/has_interface_with.rb
@@ -35,7 +35,13 @@ has_interface_with("lo") => true
kind, value = args
- if lookupvar(kind) == value
+ # 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)
+ end
+ if factval == value
return true
end
@@ -44,7 +50,11 @@ has_interface_with("lo") => true
iface.downcase!
factval = nil
begin
- factval = lookupvar("#{kind}_#{iface}")
+ # Bug with 3.7.1 - 3.7.3 when using future parser throws :undefined_variable
+ # https://tickets.puppetlabs.com/browse/PUP-3597
+ catch :undefined_variable do
+ factval = lookupvar("#{kind}_#{iface}")
+ end
rescue Puppet::ParseError # Eat the exception if strict_variables = true is set
end
if value == factval