defaultto values on properties are not respected
It appears that the properties of resources created by filemapper that have a defaultto set but do not have a value presently discoverable from the system, have a nil value. This seems to be incorrect behavior and these properties should have the defaultto value.
I just did a quick scan of the Puppet core providers and it appears that ParsedFile is one of the few that propagates this information from the type instance down to the provider instance by overwriting the inherited definition of self.mk_resource_methods:
if @property_hash[attr] or self.class.valid_attr?(self.class.name, attr)
@property_hash[attr] || :absent
else
if defined?(@resource)
@resource.should(attr)
else
nil
end
end
Note the fallthrough to @resource.should
Most providers use the default implementation defined in the top-level provider class:
@property_hash[attr] || :absent
Generally, the Type instance should represent the state in the catalog, what the resource "should be", and the Provider instance should represent the state of the system --- what the resource actually "is".
ParsedFile is full of many ideas, most of them bad. I'm not sure exposing "should" values inside the provider is one of the good ones.
Speaking of which... it looks like Filemapper used to return should values, but this behavior was pulled in a2fc3ad.
Is this still an issue?