Skip to content

Commit 4e66a93

Browse files
committed
Pass calling scope to stdlib::ensure_packages from shim
Make the `ensure_packages` shim an Internal function and pass scope to the namespaced version so as to not change the behaviour of where packages are contained. When the function was first ported to the new API, it was discussed that the existing behaviour might not be 'correct', but changing it would be a breaking change that might have consequences for many users. In namespacing the function in 9.0.0 we accidentally created a situation where the namespaced version worked as before, but the non-namespaced version, (the shim), now behaved differently. Fixes #1365
1 parent f38c42a commit 4e66a93

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
# frozen_string_literal: true
22

3-
# THIS FILE WAS GENERATED BY `rake regenerate_unamespaced_shims`
4-
53
# @summary DEPRECATED. Use the namespaced function [`stdlib::ensure_packages`](#stdlibensure_packages) instead.
6-
Puppet::Functions.create_function(:ensure_packages) do
4+
Puppet::Functions.create_function(:ensure_packages, Puppet::Functions::InternalFunction) do
75
dispatch :deprecation_gen do
6+
scope_param
87
repeated_param 'Any', :args
98
end
10-
def deprecation_gen(*args)
9+
def deprecation_gen(scope, *args)
1110
call_function('deprecation', 'ensure_packages', 'This function is deprecated, please use stdlib::ensure_packages instead.')
12-
call_function('stdlib::ensure_packages', *args)
11+
scope.call_function('stdlib::ensure_packages', *args)
1312
end
1413
end

0 commit comments

Comments
 (0)