Please review pull request #688: Better warning about metaparameter redefinitions opened by (ustuehler)

Description:

A definition such as the following, which redefines metaparameters:

define contact_info($alias = undef) {
  ...
}

generates the following warning:


warning: alias is a metaparam; this value will inherit to all contained resources

To find and fix this problem in the manifests we need to know where the parameter is defined or at least the name of the definition, which this commit adds.

  • Opened: Thu Apr 19 14:17:17 UTC 2012
  • Based on: puppetlabs:master (b7c4fe3ef4ccd9b514d2c48167fe314558eecd31)
  • Requested merge: ustuehler:master (d74f220229861ce044e17a6978c4d19ed54438ae)

Diff follows:

diff --git a/lib/puppet/resource/type.rb b/lib/puppet/resource/type.rb
index 72dbf22..bc2fbb1 100644
--- a/lib/puppet/resource/type.rb
+++ b/lib/puppet/resource/type.rb
@@ -335,7 +335,7 @@ def warn_if_metaparam(param, default)
     return unless Puppet::Type.metaparamclass(param)
 
     if default
-      warnonce "#{param} is a metaparam; this value will inherit to all contained resources"
+      warnonce "#{param} is a metaparam; this value will inherit to all contained resources in the #{self.name} definition"
     else
       raise Puppet::ParseError, "#{param} is a metaparameter; please choose another parameter name in the #{self.name} definition"
     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