Issue #22587 has been updated by Vadim Nevorotin.

Well, I think that the best way is to pass undef to all resources. Because in 
that case there is the same behavior of all values. All copy operations must do 
the same. If 'undef' is a valid value, so

        $test = undef
        $test2 = $test

and

        class foo (
          $test2 = 'test',
        ) {
          ...
        }
        
        $test = undef
        class {'foo': test2 => $test }

must work identical. In both cases $test2 must be 'undef'.

----------------------------------------
Feature #22587: Default value for all type's atrributes
https://projects.puppetlabs.com/issues/22587#change-98815

* Author: Vadim Nevorotin
* Status: Needs More Information
* Priority: Normal
* Assignee: Vadim Nevorotin
* Category: 
* Target version: 
* Affected Puppet version: 
* Keywords: 
* Branch: 
----------------------------------------
Each attribute for all built-in types must have default values. (from here: 
http://docs.puppetlabs.com/references/3.stable/type.html)

It's very important when you wrap some type with parametrized class/defined 
type. I that case you should pass parameters from container to wrapped type. So 
you must know default values for all type's attribute to add then as default 
values for class/defined type.

E.g. you has standard package->config->service parametrized class. You want to 
add enable and ensure attributes of service to main class:

class someclass (
  $ensure = ????,
  $enabled = ????,
  ...
) {

service {'someservice':
  ensure => $ensure,
  enabled => $enabled,
  ...

Now you can't simply use default values of attributes from service to class, 
because there is no default values. So behavior of whole class differs from 
behavior of a service. And so there is a lot of problems in large installations.

See http://projects.puppetlabs.com/issues/22580 - here is one of examples.


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to