modules/boltlib/lib/puppet/functions/run_task.rb in bolt-0.12.0 vs modules/boltlib/lib/puppet/functions/run_task.rb in bolt-0.13.0

- old
+ new

@@ -12,10 +12,11 @@ dispatch :run_task do param 'String[1]', :task_name param 'TargetOrTargets', :targets optional_param 'Hash[String[1], Any]', :task_args + return_type 'ExecutionResult' end # this is used from 'bolt task run' dispatch :run_task_raw do param 'String[1]', :task_name @@ -54,9 +55,14 @@ use_args = task_args.nil? ? {} : task_args task_signature.runnable_with?(use_args) do |mismatch| raise Puppet::ParseError, mismatch end || (raise Puppet::ParseError, 'Task parameters did not match') + + unless Puppet::Pops::Types::TypeFactory.data.instance?(use_args) + raise Puppet::ParseError, 'Task parameters is not of type Data' + end + task = task_signature.task if executor.noop if task.supports_noop use_args['_noop'] = true