1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
require 'puppet/resource_api'
require 'puppet/resource_api/simple_provider'
# Implementation for the test_bool type using the Resource API.
class Puppet::Provider::TestFailure::TestFailure
def get(_context)
[]
end
def set(context, changes)
changes.each do |name, change|
is = change[:is]
should = change[:should]
context.notice(name, "Creating '#{name}' with #{should.inspect}")
if should[:failure]
context.creating(name) do
raise "A failure for #{name}"
end
end
context.notice(name, "Finished")
end
end
end
|