Sha256: 2b372309646fbad2e2d5676d1909e320e4884755e7771b50982e7599773bddf2

Contents?: true

Size: 812 Bytes

Versions: 73

Compression:

Stored size: 812 Bytes

Contents

# frozen_string_literal: true

# Returns a ResultSet with canary/skipped-node errors for each Target provided.
#
# This function takes a single parameter:
# * List of nodes (Array[Variant[Target,String]])
#
# Returns a ResultSet.
Puppet::Functions.create_function(:'canary::skip') do
  dispatch :skip_result do
    param 'Array[Variant[Target,String]]', :nodes
  end

  def skip_result(nodes)
    results = nodes.map do |node|
      node = Bolt::Target.new(node) unless node.is_a? Bolt::Target
      Bolt::Result.new(node, value: { '_error' => {
                         'msg' => "Skipped #{node.name} because of a previous failure",
                         'kind' => 'canary/skipped-node',
                         'details' => {}
                       } })
    end
    Bolt::ResultSet.new(results)
  end
end

Version data entries

73 entries across 73 versions & 1 rubygems

Version Path
bolt-1.42.0 modules/canary/lib/puppet/functions/canary/skip.rb
bolt-1.41.0 modules/canary/lib/puppet/functions/canary/skip.rb
bolt-1.40.0 modules/canary/lib/puppet/functions/canary/skip.rb
bolt-1.39.0 modules/canary/lib/puppet/functions/canary/skip.rb
bolt-1.38.0 modules/canary/lib/puppet/functions/canary/skip.rb
bolt-1.37.0 modules/canary/lib/puppet/functions/canary/skip.rb
bolt-1.36.0 modules/canary/lib/puppet/functions/canary/skip.rb
bolt-1.35.0 modules/canary/lib/puppet/functions/canary/skip.rb
bolt-1.34.0 modules/canary/lib/puppet/functions/canary/skip.rb
bolt-1.33.0 modules/canary/lib/puppet/functions/canary/skip.rb
bolt-1.32.0 modules/canary/lib/puppet/functions/canary/skip.rb
bolt-1.31.1 modules/canary/lib/puppet/functions/canary/skip.rb
bolt-1.31.0 modules/canary/lib/puppet/functions/canary/skip.rb
bolt-1.30.1 modules/canary/lib/puppet/functions/canary/skip.rb
bolt-1.30.0 modules/canary/lib/puppet/functions/canary/skip.rb
bolt-1.29.1 modules/canary/lib/puppet/functions/canary/skip.rb
bolt-1.29.0 modules/canary/lib/puppet/functions/canary/skip.rb
bolt-1.28.0 modules/canary/lib/puppet/functions/canary/skip.rb
bolt-1.27.1 modules/canary/lib/puppet/functions/canary/skip.rb
bolt-1.27.0 modules/canary/lib/puppet/functions/canary/skip.rb