Issue #16221 has been updated by Daniel Pittman.
Erik Dalén wrote: > Would the recommended method for creating a resource and passing nothing for > some of the values be to use create_resources() and a config hash like in > [puppetlabs-mysql/manifests/server.pp](https://github.com/puppetlabs/puppetlabs-mysql/blob/master/manifests/server.pp) > lines 28-30? That would be a reasonable work-around, I think. In general this pattern is a "design smell" - the defaults really belong up on the top level "features" that people use, not the low level implementation. Even if both high level consumers of that implementation class have the same default, over time that is likely to change - because, hey, if they were going to stay the same they would be the same class, not two different classes, right? So, this is (in my experience) usually a pattern where someone is avoiding code duplication because it seems right, even though it isn't actually necessary. The usual end game is where both high level consumers *and* the low level implementation all have default values, all different, because nobody removes the low level one even when it is never used. > So if you decide to change the behavior here I think you should change the > style guideline as well. That isn't a bad suggestion, at all. ---------------------------------------- Bug #16221: Passing undef as argument to classes & defines overrides default parameter https://projects.puppetlabs.com/issues/16221#change-71022 Author: Erik Dalén Status: Closed Priority: Normal Assignee: eric sorenson Category: Target version: 3.0.0 Affected Puppet version: 3.0.0-rc5 Keywords: parameter undef Branch: In puppet 3.0.0-rc5 the default value is overridden if I pass undef as a parameter to a define or class. Example: define bar ($param='Hello world') { notice($param) } define foo ($param=undef) { bar { 'bartest': param => $param } } foo { 'footest': } In puppet 2.7.19 that outputs: notice: Scope(Bar[bartest]): Hello world But in puppet 3.0.0-rc5 I get: Scope(Bar[test]): -- You have received this notification because you have either subscribed to it, or are involved in it. To change your notification preferences, please click here: http://projects.puppetlabs.com/my/account -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" 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-bugs?hl=en.
