Skip to content

Commit f2492ee

Browse files
authored
Merge pull request #674 from DavidS/modules-3969-fix-getvar-for-187
(MODULES-3969) Update getvar to work on ruby 1.8.7
2 parents d990021 + 1d75813 commit f2492ee

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ This bugfix release addresses the `undefined method 'optional_repeated_param'` e
55

66
It also improves the user experience around function deprecations by emitting one warning per function(-name) instead of only one deprecation overall. This allows users to identify all deprecated functions used in one agent run, with less back-and-forth.
77

8-
Finally, this release adds additional Puppet 4 overrides for the `is_` counterparts of the deprecated functions to emit the deprecations warnings in all cases.
8+
#### Bugfixes
9+
10+
* Emit deprecations warnings for each function, instead of once per process. (MODULES-3961)
11+
* Use a universally available API for the v4 deprecation stubs of `is_*` and `validate_*`. (MODULES-3962)
12+
* Make `getvar()` compatible to ruby 1.8.7. (MODULES-3969)
13+
* Add v4 deprecation stubs for the `is_` counterparts of the deprecated functions to emit the deprecations warnings in all cases.
14+
915

1016
## Supported Release 4.13.0
1117
### Summary

lib/puppet/parser/functions/getvar.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@ module Puppet::Parser::Functions
2020
end
2121

2222
begin
23+
result = nil
2324
catch(:undefined_variable) do
24-
return self.lookupvar("#{args[0]}")
25+
result = self.lookupvar("#{args[0]}")
2526
end
26-
27-
nil # throw was caught
27+
28+
# avoid relying on incosistent behaviour around ruby return values from catch
29+
result
2830
rescue Puppet::ParseError # Eat the exception if strict_variables = true is set
2931
end
3032

0 commit comments

Comments
 (0)