Puppet Function: choria::tasks::validate_input
- Defined in:
- lib/puppet/functions/choria/tasks/validate_input.rb
- Function type:
- Ruby 4.x API
Overview
Validates that the input given would be acceptable to a task described by ‘metadata`
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/puppet/functions/choria/tasks/validate_input.rb', line 4 Puppet::Functions.create_function(:"choria::tasks::validate_input") do dispatch :validate do param "Hash", :input param "Hash", :metadata end def init require_relative "../../../_load_choria" end def choria @_choria ||= begin init MCollective::Util::Choria.new end end def tasks_support @__tasks ||= choria.tasks_support end def validate(input, ) ok, reason = tasks_support.validate_task_inputs(input, ) return true if ok raise(reason) end end |