J --
After thinking it through, I agree that #evaluate should be idempotent.
>
Ok.
> I don't want to lose the tests for #builtin_type? and #virtual? though. I'm
> not convinced that it makes sense to fold them into #evaluate - currently
> built-in types raise an error, and it would be a behavior change to make
> those a no-op. I'm not even sure what it means to evaluate virtual
> resources.
>
I have no idea what your concern is here. I wasn't proposing eliminating
any such tests or folding them in anywhere.
> So... are you proposing we keep the old #unevaluated_resources method?
Yes.
> After getting burned by it, I feel like I want to have it disappear.
>
Ah, but you weren't burned by it, you just happened to be looking at it when
you discovered that you were being burned by the side effects of resource
evaluation combined with its non-idempotency.
Consider an analogy: if you were using bash to invoke a "move" program you'd
written and typed something like:
move *.rb source/
and then discovered that your move program sometimes moved files it wasn't
asked to and blew up if asked to move a missing file would you:
1) blame bash's file gloming (since you were burned by it) and do something
like:
for f in *.rb; do if [[ -f $f ]]; then move $f source/; fi; done
2) fix the move program so it wasn't so hard to reason about?
So far as I can see unevaluated_resources was doing exactly what you'd
expect, with no side effects or odd corner cases. Resource#evaluate, on the
other hand...
-- M
-----------------------------------------------------------
The power of accurate observation is
commonly called cynicism by those
who have not got it. ~George Bernard Shaw
------------------------------------------------------------
--
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.