Suggest different variables to use if we want to tunnel both v4 and v6
[mirror/dsa-puppet.git] / 3rdparty / modules / stdlib / lib / puppet / parser / functions / deprecation.rb
1 #
2 # deprecation.rb
3 #
4 module Puppet::Parser::Functions
5   newfunction(:deprecation, :doc => <<-DOC
6   Function to print deprecation warnings (this is the 3.X version of it), The uniqueness key - can appear once. The msg is the message text including any positional information that is formatted by the user/caller of the method.).
7 DOC
8              ) do |arguments|
9
10     raise(Puppet::ParseError, "deprecation: Wrong number of arguments given (#{arguments.size} for 2)") unless arguments.size == 2
11
12     key = arguments[0]
13     message = arguments[1]
14
15     if ENV['STDLIB_LOG_DEPRECATIONS'] == 'true'
16       warning("deprecation. #{key}. #{message}")
17     end
18   end
19 end