Please review pull request #694: Feature/2.7.14rc1/14101 improved dynamic scope warning message opened by (zaphod42)

Description:

The deprecation warning about different variable lookups didn't provide
a lot of information that would aid in resolving the issue. It now
prints out the two values found so that we can tell the user what the
change will end up being.

  • Opened: Thu Apr 19 23:52:18 UTC 2012
  • Based on: puppetlabs:2.7.14rc1 (3a4ac604c85952511fd45c2f0699ce956eda3773)
  • Requested merge: zaphod42:feature/2.7.14rc1/14101-improved-dynamic-scope-warning-message (94bf789e2ca11ac637dee6d92da062998cb3de6b)

Diff follows:

diff --git a/lib/puppet/parser/scope.rb b/lib/puppet/parser/scope.rb
index 569c3c8..f545ba7 100644
--- a/lib/puppet/parser/scope.rb
+++ b/lib/puppet/parser/scope.rb
@@ -229,7 +229,7 @@ def lookupvar(name, options = {})
     twoscope_value = twoscope_lookupvar(name,options)
     if dynamic_value != twoscope_value
       location = (options[:file] && options[:line]) ? " at #{options[:file]}:#{options[:line]}" : ''
-      Puppet.deprecation_warning "Dynamic lookup of $#{name}#{location} is deprecated.  Support will be removed in a later version of Puppet.  Use a fully-qualified variable name (e.g., $classname::variable) or parameterized classes."
+      Puppet.deprecation_warning "Dynamic lookup of $#{name}#{location} is deprecated. Support will be removed in a later version of Puppet. Use a fully-qualified variable name (e.g., $classname::variable) or parameterized classes. Current lookup found: #{dynamic_value.inspect} / Later versions will find: #{twoscope_value.inspect}"
     end
     dynamic_value
   end

    

--
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to