bolt 3.21.0 → 3.23.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.

Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/Puppetfile +7 -7
  3. data/bolt-modules/boltlib/lib/puppet/functions/puppetdb_command.rb +32 -1
  4. data/bolt-modules/boltlib/lib/puppet/functions/puppetdb_fact.rb +20 -1
  5. data/bolt-modules/boltlib/lib/puppet/functions/puppetdb_query.rb +23 -1
  6. data/bolt-modules/boltlib/lib/puppet/functions/run_task.rb +28 -23
  7. data/bolt-modules/boltlib/lib/puppet/functions/run_task_with.rb +22 -19
  8. data/lib/bolt/applicator.rb +8 -2
  9. data/lib/bolt/bolt_option_parser.rb +4 -1
  10. data/lib/bolt/catalog.rb +1 -1
  11. data/lib/bolt/config/options.rb +73 -49
  12. data/lib/bolt/config.rb +12 -3
  13. data/lib/bolt/module.rb +6 -0
  14. data/lib/bolt/outputter/human.rb +8 -3
  15. data/lib/bolt/pal/yaml_plan/loader.rb +1 -1
  16. data/lib/bolt/pal.rb +6 -2
  17. data/lib/bolt/plugin/env_var.rb +17 -1
  18. data/lib/bolt/plugin/puppetdb.rb +14 -4
  19. data/lib/bolt/plugin.rb +2 -1
  20. data/lib/bolt/project.rb +4 -0
  21. data/lib/bolt/puppetdb/client.rb +90 -129
  22. data/lib/bolt/puppetdb/config.rb +21 -8
  23. data/lib/bolt/puppetdb/instance.rb +146 -0
  24. data/lib/bolt/result.rb +1 -1
  25. data/lib/bolt/transport/ssh/exec_connection.rb +5 -2
  26. data/lib/bolt/util.rb +1 -1
  27. data/lib/bolt/version.rb +1 -1
  28. data/lib/bolt_server/transport_app.rb +1 -0
  29. data/lib/bolt_spec/plans/action_stubs/download_stub.rb +1 -1
  30. data/lib/bolt_spec/plans/action_stubs/plan_stub.rb +1 -1
  31. data/lib/bolt_spec/plans/action_stubs/task_stub.rb +1 -1
  32. data/lib/bolt_spec/plans/action_stubs/upload_stub.rb +1 -1
  33. data/lib/bolt_spec/plans/action_stubs.rb +2 -2
  34. data/lib/bolt_spec/plans/mock_executor.rb +1 -1
  35. data/lib/bolt_spec/plans.rb +11 -1
  36. metadata +5 -4
@@ -37,7 +37,7 @@ module BoltSpec
37
37
  end
38
38
 
39
39
  # Allow any data.
40
- def result_for(target, data)
40
+ def result_for(target, **data)
41
41
  Bolt::Result.new(target, value: Bolt::Util.walk_keys(data, &:to_s))
42
42
  end
43
43
 
@@ -40,7 +40,7 @@ module BoltSpec
40
40
  @invocation[:options]
41
41
  end
42
42
 
43
- def result_for(_target, _data)
43
+ def result_for(_target, **_data)
44
44
  raise 'Upload result cannot be changed'
45
45
  end
46
46
 
@@ -93,7 +93,7 @@ module BoltSpec
93
93
  when Bolt::Error
94
94
  Bolt::Result.from_exception(target, @data[:default])
95
95
  when Hash
96
- result_for(target, Bolt::Util.walk_keys(@data[:default], &:to_sym))
96
+ result_for(target, **Bolt::Util.walk_keys(@data[:default], &:to_sym))
97
97
  else
98
98
  raise 'Default result must be a Hash'
99
99
  end
@@ -156,7 +156,7 @@ module BoltSpec
156
156
  # set the inventory from the BoltSpec::Plans, otherwise if we try to convert
157
157
  # this target to a string, it will fail to string conversion because the
158
158
  # inventory is nil
159
- hsh[target] = result_for(Bolt::Target.new(target, @inventory), Bolt::Util.walk_keys(result, &:to_sym))
159
+ hsh[target] = result_for(Bolt::Target.new(target, @inventory), **Bolt::Util.walk_keys(result, &:to_sym))
160
160
  end
161
161
  raise "Cannot set return values and return block." if @return_block
162
162
  @data_set = true
@@ -210,7 +210,7 @@ module BoltSpec
210
210
  @allow_apply = true
211
211
  end
212
212
 
213
- def wait_until_available(targets, _options)
213
+ def wait_until_available(targets, **_options)
214
214
  Bolt::ResultSet.new(targets.map { |target| Bolt::Result.new(target) })
215
215
  end
216
216
 
@@ -103,6 +103,16 @@ module BoltSpec
103
103
 
104
104
  # Provided as a class so expectations can be placed on it.
105
105
  class MockPuppetDBClient
106
+ def initialize(config)
107
+ @instance = MockPuppetDBInstance.new(config)
108
+ end
109
+
110
+ def instance(_instance)
111
+ @instance
112
+ end
113
+ end
114
+
115
+ class MockPuppetDBInstance
106
116
  attr_reader :config
107
117
 
108
118
  def initialize(config)
@@ -111,7 +121,7 @@ module BoltSpec
111
121
  end
112
122
 
113
123
  def puppetdb_client
114
- @puppetdb_client ||= MockPuppetDBClient.new(Bolt::PuppetDB::Config.new({}))
124
+ @puppetdb_client ||= MockPuppetDBClient.new({})
115
125
  end
116
126
 
117
127
  def run_plan(name, params)
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: 3.21.0
4
+ version: 3.23.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-12-16 00:00:00.000000000 Z
11
+ date: 2022-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -566,6 +566,7 @@ files:
566
566
  - lib/bolt/puppetdb.rb
567
567
  - lib/bolt/puppetdb/client.rb
568
568
  - lib/bolt/puppetdb/config.rb
569
+ - lib/bolt/puppetdb/instance.rb
569
570
  - lib/bolt/r10k_log_proxy.rb
570
571
  - lib/bolt/rerun.rb
571
572
  - lib/bolt/resource_instance.rb
@@ -664,7 +665,7 @@ require_paths:
664
665
  - lib
665
666
  required_ruby_version: !ruby/object:Gem::Requirement
666
667
  requirements:
667
- - - "~>"
668
+ - - ">="
668
669
  - !ruby/object:Gem::Version
669
670
  version: '2.5'
670
671
  required_rubygems_version: !ruby/object:Gem::Requirement
@@ -673,7 +674,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
673
674
  - !ruby/object:Gem::Version
674
675
  version: '0'
675
676
  requirements: []
676
- rubygems_version: 3.0.8
677
+ rubygems_version: 3.0.9
677
678
  signing_key:
678
679
  specification_version: 4
679
680
  summary: Execute commands remotely over SSH and WinRM