summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/functions/deprecation.rb6
-rw-r--r--lib/puppet/functions/type_of.rb2
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/puppet/functions/deprecation.rb b/lib/puppet/functions/deprecation.rb
index a860aa2..39d9bc7 100644
--- a/lib/puppet/functions/deprecation.rb
+++ b/lib/puppet/functions/deprecation.rb
@@ -8,6 +8,12 @@ Puppet::Functions.create_function(:deprecation) do
end
def deprecation(key, message)
+ if defined? Puppet::Pops::PuppetStack.stacktrace()
+ stacktrace = Puppet::Pops::PuppetStack.stacktrace()
+ file = stacktrace[0]
+ line = stacktrace[1]
+ message = "#{message} at #{file}:#{line}"
+ end
# depending on configuration setting of strict
case Puppet.settings[:strict]
when :off
diff --git a/lib/puppet/functions/type_of.rb b/lib/puppet/functions/type_of.rb
index 02cdd4d..01f1f49 100644
--- a/lib/puppet/functions/type_of.rb
+++ b/lib/puppet/functions/type_of.rb
@@ -10,6 +10,8 @@
# See the documentation for "The Puppet Type System" for more information about types.
# See the `assert_type()` function for flexible ways to assert the type of a value.
#
+# The built-in type() function in puppet is generally preferred over this function
+# this function is provided for backwards compatibility.
Puppet::Functions.create_function(:type_of) do
def type_of(value)
Puppet::Pops::Types::TypeCalculator.infer_set(value)