On Jul 7, 2010, at 2:03 PM, Jesse A Wolfe wrote:

Basically, 'ensure' trumps everything - if it's out of sync, nothing else
really matters.

In cases where ensure is absent/present, this holds. But if you've got
other options (changing a service from "stopped" to "running", for
example), then you may still care about other changes on the resource.
I'm starting to believe that this is a misuse of "ensure" for it to
mean something so different on certain types.

I agree that this is a bit of an abuse of the model, and this stems from the fact that the specialness of ensure is in code and not really modeled per se.

In the short term, the only real way to "fix" it is to have each of these changes specifically call out to all of the other changes that could happen; in the long term, of course, you'd like to be able to declare whether a given state transition is clobbering or not. (I.e., file removal is clobbering, stopping a service isn't.)

On Wed, Jul 7, 2010 at 1:53 PM, Luke Kanies <[email protected]> wrote:
Yeah, this is important mostly because, e.g., if the file is absent we don't want to try to see if the mode should be changed. Also, if we're going to
delete the file, who cares if the content isn't in sync?

Basically, 'ensure' trumps everything - if it's out of sync, nothing else
really matters.

On Jul 7, 2010, at 10:36 AM, Jesse Wolfe wrote:

If "ensure" changes, then no other changes are logged for that resource.
I'm not sure why this special case is here. If I remove it, like so,
then what happens?

Signed-off-by: Jesse Wolfe <[email protected]>
---
lib/puppet/transaction/resource_harness.rb |    3 +--
1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/lib/puppet/transaction/resource_harness.rb
b/lib/puppet/transaction/resource_harness.rb
index ae38bcb..7c1d019 100644
--- a/lib/puppet/transaction/resource_harness.rb
+++ b/lib/puppet/transaction/resource_harness.rb
@@ -48,11 +48,10 @@ class Puppet::Transaction::ResourceHarness

       if param = resource.parameter(:ensure)
return [] if absent_and_not_being_created?(current, param)
-            return [Puppet::Transaction::Change.new(param,
current[:ensure])] unless ensure_is_insync?(current, param)
           return [] if ensure_should_be_absent?(current, param)
       end

- resource.properties.reject { |p| p.name == :ensure }.reject do
|param|
+        resource.properties.reject do |param|
           param.should.nil?
       end.reject do |param|
           param_is_insync?(current, param)
--
1.7.0.4

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



--
True Terror is to wake up one morning and discover that your high
school class is running the country. -- Kurt Vonnegut
---------------------------------------------------------------------
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.



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



--
It isn't necessary to have relatives in Kansas City in order to be
unhappy. -- Groucho Marx
---------------------------------------------------------------------
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