Method: Puppet::Type#validate_resource

Defined in:
lib/puppet/type.rb

#validate_resourcevoid

This method returns an undefined value.

Optionally validate the resource. This method is a noop if the type has not defined a ‘validate` method using the puppet DSL. If validation fails, then an exception will be raised with this resources as the context.



2357
2358
2359
2360
2361
2362
2363
# File 'lib/puppet/type.rb', line 2357

def validate_resource
  validate if respond_to?(:validate)
rescue Puppet::Error, ArgumentError => detail
  error = Puppet::ResourceError.new("Validation of #{ref} failed: #{detail}")
  adderrorcontext(error, detail)
  raise error
end