bolt 2.3.1 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of bolt might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c8356c3c6f44472186a0239d157a58c84f9cbb80ce9d37ee5e41287383e3c967
4
- data.tar.gz: 348ee76cf7498279bdedd126ecd538f2186518f904eb65e74747b9d5c560eada
3
+ metadata.gz: ba000a9935f93ebac58dc466b10dc06da8ca5468c9d2d531d2b1067154dd90f1
4
+ data.tar.gz: 202b98a6d9f6d50dc6864f519a711c4e66a24dab5e16130231164b4c127ea82a
5
5
  SHA512:
6
- metadata.gz: 1789b9c294a1968c391d68edf3bfc8a1f3f9647ec3331ec3c192b721886c3406b6bd91ff1fd932315efa189c395106bf650e55c0975b3a3cde1c3db0c645147b
7
- data.tar.gz: 6e5c7b4a944725d382b8aec9a2b7c003a58a8328c7a093276fe281d01563a3ee011ee4e2035b1530bab7a1b5d566f87f45659ee5d7c4cad5cf2a70356e6f3384
6
+ metadata.gz: e76933cea7a2b3fd3ee860dd21a938b860892559578c2b494647da0c24308102d81c592c230ee22e676ab5b843db77e38b349b41dff5cfb75bbe7c498ee1e023
7
+ data.tar.gz: df316bb99de15abb03b2d885f6a46e2a45e8649baea5745f8c9efc7b95cc874b9322a616c0fca7020cac9fb4748ec5d5577f3415833c56ad85e766fcd9bd6bfd
data/Puppetfile CHANGED
@@ -31,7 +31,7 @@ mod 'puppetlabs-ruby_plugin_helper', '0.1.0'
31
31
 
32
32
  # Plugin modules
33
33
  mod 'puppetlabs-azure_inventory', '0.3.0'
34
- mod 'puppetlabs-terraform', '0.4.0'
34
+ mod 'puppetlabs-terraform', '0.5.0'
35
35
  mod 'puppetlabs-vault', '0.3.0'
36
36
  mod 'puppetlabs-aws_inventory', '0.5.0'
37
37
  mod 'puppetlabs-yaml', '0.2.0'
@@ -11,7 +11,7 @@ module Bolt
11
11
  end
12
12
  end
13
13
 
14
- TEMPLATE_OPTS = %w[uri name config].freeze
14
+ TEMPLATE_OPTS = %w[alias config facts features name uri vars].freeze
15
15
  PLUGIN_OPTS = %w[_plugin query target_mapping].freeze
16
16
 
17
17
  def initialize(pdb_client)
@@ -83,10 +83,14 @@ module Bolt
83
83
  def resolve_facts(config, certname, target_data)
84
84
  Bolt::Util.walk_vals(config) do |value|
85
85
  if value.is_a?(String)
86
- data = target_data&.detect { |d| d['path'] == fact_path(value) }
87
- warn_missing_fact(certname, value) if data.nil?
88
- # If there's no fact data this will be nil
89
- data&.fetch('value', nil)
86
+ if value == 'certname'
87
+ certname
88
+ else
89
+ data = target_data&.detect { |d| d['path'] == fact_path(value) }
90
+ warn_missing_fact(certname, value) if data.nil?
91
+ # If there's no fact data this will be nil
92
+ data&.fetch('value', nil)
93
+ end
90
94
  elsif value.is_a?(Array) || value.is_a?(Hash)
91
95
  value
92
96
  else
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bolt
4
- VERSION = '2.3.1'
4
+ VERSION = '2.4.0'
5
5
  end
@@ -57,12 +57,19 @@ module BoltServer
57
57
  end
58
58
 
59
59
  def scrub_stack_trace(result)
60
- if result.dig(:result, '_error', 'details', 'stack_trace')
61
- result[:result]['_error']['details'].reject! { |k| k == 'stack_trace' }
60
+ if result.dig(:value, '_error', 'details', 'stack_trace')
61
+ result[:value]['_error']['details'].reject! { |k| k == 'stack_trace' }
62
62
  end
63
63
  result
64
64
  end
65
65
 
66
+ def error_result(error)
67
+ {
68
+ 'status' => 'failure',
69
+ 'value' => { '_error' => error.to_h }
70
+ }
71
+ end
72
+
66
73
  def validate_schema(schema, body)
67
74
  schema_error = JSON::Validator.fully_validate(schema, body)
68
75
  if schema_error.any?
@@ -280,7 +287,7 @@ module BoltServer
280
287
  body = JSON.parse(request.body.read)
281
288
 
282
289
  error = validate_schema(@schemas["transport-ssh"], body)
283
- return [400, error.to_json] unless error.nil?
290
+ return [400, error_result(error).to_json] unless error.nil?
284
291
 
285
292
  targets = (body['targets'] || [body['target']]).map do |target|
286
293
  make_ssh_target(target)
@@ -320,7 +327,7 @@ module BoltServer
320
327
  body = JSON.parse(request.body.read)
321
328
 
322
329
  error = validate_schema(@schemas["transport-winrm"], body)
323
- return [400, error.to_json] unless error.nil?
330
+ return [400, error_result(error).to_json] unless error.nil?
324
331
 
325
332
  targets = (body['targets'] || [body['target']]).map do |target|
326
333
  make_winrm_target(target)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bolt
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.1
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-30 00:00:00.000000000 Z
11
+ date: 2020-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable