Skip to content

Commit 428f9b1

Browse files
committed
Update ntp_dirname to proper deprecation
1 parent b47b572 commit 428f9b1

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

lib/puppet/functions/ntp_dirname.rb

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Puppet::Functions.create_function(:ntp_dirname, Puppet::Functions::InternalFunction) do
2+
dispatch :ntp_dirname do
3+
scope_param
4+
optional_repeated_param 'Any', :args
5+
end
6+
def ntp_dirname(scope, *args)
7+
call_function('deprecation', 'ntp_dirname_removal', "ntp_dirname(): this function is deprecated and will be removed at a later time.")
8+
scope.send("function_ntp_dirname", args)
9+
end
10+
end

lib/puppet/parser/functions/ntp_dirname.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module Puppet::Parser::Functions
77
raise(Puppet::ParseError, "ntp_dirname(): Wrong number of arguments " +
88
"given (#{arguments.size} for 1)") if arguments.size < 1
99

10-
warning("ntp_dirname(): this function is deprecated and will be removed at a later time.")
10+
function_deprecation([:ntp_dirname_removal, 'ntp_dirname(): this function is deprecated and will be removed at a later time.'])
1111

1212
path = arguments[0]
1313
return File.dirname(path)

0 commit comments

Comments
 (0)