--
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-dev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/94724428-5db3-4409-b710-9e2847bd1c47%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/94724428-5db3-4409-b710-9e2847bd1c47%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--Trevor Vaughan
Vice President, Onyx Point, Inc
-- This account not approved for unencrypted proprietary information --
Exists should be checking the @property_hash object which is populated by the instances method.
Something like:
def exists?
@property_hash[:ensure] == :present
end
I haven't dived into the code recently but depending on when prefetching happens, it might be possible the Transition type is causing an "early" invocation of #exists?. This is because Transition invokes a check of the resource it is "prior to", thusly: https://github.com/puppetlabs/puppetlabs-transition/blob/0.1.1/lib/puppet/provider/transition/ruby.rb#L68If it's the case that prefetch isn't called until the first instance of a given type is evaluated, that might be something that's happening *after* the Transition resource does its thing. Which could help explain why your exists?() method, which uses prefetched data, isn't working.
file { 'prefetch':path => '/dev/null',ensure => present,}transition { 'transition a file resource':require => File['prefetch'],resource => File['/path/to/real/file'],attributes => { ensure => absent },prior_to => Service['example'],}