On Apr 14, 2010, at 4:28 PM, Peter Meier wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi

so my fix for #3540 [1] revealed another problem #3555 [2] which I try
to fix now. But I'm a currently a bit lost in finding the right point to
change the provider to the correct behavior.

So my initial idea was to tell the provider that it is the same if a
list is purged or set to absent. However I couldn't really figure out
where the ultimate decision is made that the list isn't absent hence it must be created and how to overwrite that behavior. (Btw: to me it looks
only like a transaction reporting problem, as the rest works fine!)
Later, I had the idea to overwrite the ensure property to absent after
purging, so everything would be fine. However I considered that as a
stupid idea which might have nasty side effects. So now I'm now a bit
stuck and only other bad ideas come up. :/

Hence, I would be glad if somebody could give me some hints of what
might be the appropriate solution or at least where to look at the code
and to understand the current concept.

Well, there's a change_to_s method that you could override to provide the right message.

My guess is that the default 'ensure' type is getting confused somehow because it doesn't know what message it should use for 'purged'. Something like:

  def change_to_s(current_value, newvalue)
    if newvalue == :purged
      return "Purged #{resource}"
    else
      return super
    end
  end

Not tested, but something like that.

Lemme know if that doesn't work out.

And I'm stoked to see someone's actually using this type. :)

--
Should I say "I believe in physics", or "I know that physics is true"?
    -- Ludwig Wittgenstein, On Certainty, 602.
---------------------------------------------------------------------
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