summaryrefslogtreecommitdiff
path: root/lib/puppet
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/functions/deprecation.rb2
-rw-r--r--lib/puppet/parser/functions/deprecation.rb6
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/puppet/functions/deprecation.rb b/lib/puppet/functions/deprecation.rb
index 3b84ae5..6b7b977 100644
--- a/lib/puppet/functions/deprecation.rb
+++ b/lib/puppet/functions/deprecation.rb
@@ -15,7 +15,7 @@ Puppet::Functions.create_function(:deprecation) do
when :error
fail("deprecation. #{key}. #{message}")
else
- Puppet.warn_once('deprecation', key, message)
+ Puppet.deprecation_warning(message, key)
end
end
end
diff --git a/lib/puppet/parser/functions/deprecation.rb b/lib/puppet/parser/functions/deprecation.rb
index fc861a6..e30f3a0 100644
--- a/lib/puppet/parser/functions/deprecation.rb
+++ b/lib/puppet/parser/functions/deprecation.rb
@@ -9,7 +9,9 @@ EOS
key = arguments[0]
message = arguments[1]
-
- warning("deprecation. #{key}. #{message}")
+
+ if ENV['STDLIB_LOG_DEPRECATIONS'] == "true"
+ warning("deprecation. #{key}. #{message}")
+ end
end
end