puppetlabs/puppet — pull request #1100 by stschulte (2012-08-31 21:48:58+00:00)
Title: (#5752) Handle read errors in parsedfile provider

The parsedfile provider can handle multiple targets (multiple files,
multiple crontabs, etc) but the provider does not handle the case when
retrieving a target during prefetch fails. When the provider does only
handle one target this doesn't really matter because a possible error is
caught at a higher level (inside Puppet::Transaction). But if the
provider handles multiple targets, one error will cause the whole
prefetching method to fail and all targets are treated as empty.

One example of the issue is described in #5752: Multiple crontabs are
manages with crontab resources and one cronresource describes a
cronentry of an absent user. Because prefetching the crontab of the
absent user fails, the crontab of *all* users are purged and every
crontab entry which is not managed by puppet is lost.

The change now handles the error inside the parsedfile provider itself,
so only the target that is causing troubles is treated as empty.