On Jul 10, 2010, at 10:08 AM, Markus Roberts wrote:

After mulling this a while, I think the real issue is that we're
treating ensure as an attribute-set rather than as an attribute.  It's
a magic feature that semantically sets a whole slew of features.  When
we say "ensure => present" we really mean "present => true" and so on:

"ensure => absent" means "present => false"
"ensure => 3.2" means "present => true; version => 3.2"
"ensure => running" means "present => true; running => true"
"ensure => eatable" means "present => true; toxic => false; palatable => true"

and so on.  Then all the special casing is on the two-valued "present"
attribute instead of trying to figure out what "ensure => scrumulous"
means, we just say that any of the above which set "present => false"
also set all other state attributes to undef, while leaving identity
attributes (e.g. name, target, provider) unchanged.

This seems like a reasonable conclusion, but how do you plan on implementing it? Actually creating multiple parameters?

How does this change if we treat 'ensure' as a state machine, as we've been "planning" on doing for a while?

Isn't it more like certain states or state transitions swamp all other out-of-sync parameters and others don't?

I'm not saying you can't figure out how to treat 'ensure' as multiple parameters, but I never had much luck in my paltry attempts at it. In fact, the only case where I tried splitting it up -- services, with 'enable => true' and 'ensure => running' -- is essentially a usability disaster.

--
Aizu's Second Law:
    What changes the world is communication, not information.
---------------------------------------------------------------------
Luke Kanies  -|-   http://puppetlabs.com   -|-   +1(615)594-8199

--
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