lib/puppet/resource_api.rb in puppet-resource_api-1.8.9 vs lib/puppet/resource_api.rb in puppet-resource_api-1.8.10

- old
+ new

@@ -329,10 +329,13 @@ if type_definition.feature?('supports_noop') my_provider.set(context, { rsapi_title => { is: @rsapi_current_state, should: target_state } }, noop: noop?) else my_provider.set(context, rsapi_title => { is: @rsapi_current_state, should: target_state }) unless noop? end - raise 'Execution encountered an error' if context.failed? + if context.failed? + context.reset_failed + raise 'Execution encountered an error' + end # remember that we have successfully reached our desired state @rsapi_current_state = target_state end