test-kitchen 1.19.2 → 1.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitattributes +0 -0
- data/.github/ISSUE_TEMPLATE.md +0 -0
- data/.gitignore +1 -0
- data/.kitchen.ci.yml +0 -0
- data/.kitchen.dokken.yml +0 -0
- data/.kitchen.proxy.yml +0 -0
- data/.rubocop.yml +0 -0
- data/.travis.yml +0 -0
- data/.yardopts +0 -0
- data/Berksfile +0 -0
- data/CHANGELOG.md +66 -0
- data/CONTRIBUTING.md +0 -0
- data/ECOSYSTEM.md +0 -0
- data/Gemfile +0 -0
- data/Gemfile.proxy_tests +0 -0
- data/Guardfile +0 -0
- data/LICENSE +0 -0
- data/MAINTAINERS.md +0 -0
- data/README.md +0 -0
- data/Rakefile +0 -0
- data/appveyor.yml +0 -0
- data/features/kitchen_action_commands.feature +0 -0
- data/features/kitchen_command.feature +0 -0
- data/features/kitchen_console_command.feature +0 -0
- data/features/kitchen_defaults.feature +0 -0
- data/features/kitchen_diagnose_command.feature +0 -0
- data/features/kitchen_help_command.feature +0 -0
- data/features/kitchen_init_command.feature +0 -0
- data/features/kitchen_list_command.feature +0 -0
- data/features/kitchen_login_command.feature +0 -0
- data/features/kitchen_sink_command.feature +0 -0
- data/features/kitchen_test_command.feature +0 -0
- data/features/step_definitions/gem_steps.rb +0 -0
- data/features/step_definitions/git_steps.rb +0 -0
- data/features/step_definitions/output_steps.rb +0 -0
- data/features/support/env.rb +0 -0
- data/lib/kitchen.rb +0 -0
- data/lib/kitchen/base64_stream.rb +0 -0
- data/lib/kitchen/cli.rb +0 -0
- data/lib/kitchen/collection.rb +0 -0
- data/lib/kitchen/color.rb +0 -0
- data/lib/kitchen/command.rb +0 -0
- data/lib/kitchen/command/action.rb +0 -0
- data/lib/kitchen/command/console.rb +0 -0
- data/lib/kitchen/command/diagnose.rb +0 -0
- data/lib/kitchen/command/doctor.rb +0 -0
- data/lib/kitchen/command/exec.rb +0 -0
- data/lib/kitchen/command/list.rb +0 -0
- data/lib/kitchen/command/login.rb +0 -0
- data/lib/kitchen/command/package.rb +0 -0
- data/lib/kitchen/command/sink.rb +0 -0
- data/lib/kitchen/command/test.rb +0 -0
- data/lib/kitchen/config.rb +0 -0
- data/lib/kitchen/configurable.rb +68 -0
- data/lib/kitchen/data_munger.rb +0 -0
- data/lib/kitchen/diagnostic.rb +0 -0
- data/lib/kitchen/driver.rb +0 -0
- data/lib/kitchen/driver/base.rb +0 -0
- data/lib/kitchen/driver/dummy.rb +0 -0
- data/lib/kitchen/driver/exec.rb +0 -0
- data/lib/kitchen/driver/proxy.rb +0 -0
- data/lib/kitchen/driver/ssh_base.rb +6 -0
- data/lib/kitchen/errors.rb +0 -0
- data/lib/kitchen/generator/init.rb +0 -0
- data/lib/kitchen/instance.rb +0 -0
- data/lib/kitchen/lazy_hash.rb +8 -0
- data/lib/kitchen/loader/yaml.rb +3 -3
- data/lib/kitchen/logger.rb +0 -0
- data/lib/kitchen/logging.rb +0 -0
- data/lib/kitchen/login_command.rb +0 -0
- data/lib/kitchen/metadata_chopper.rb +0 -0
- data/lib/kitchen/platform.rb +0 -0
- data/lib/kitchen/provisioner.rb +0 -0
- data/lib/kitchen/provisioner/base.rb +8 -0
- data/lib/kitchen/provisioner/chef/berkshelf.rb +0 -0
- data/lib/kitchen/provisioner/chef/common_sandbox.rb +5 -1
- data/lib/kitchen/provisioner/chef/librarian.rb +0 -0
- data/lib/kitchen/provisioner/chef/policyfile.rb +0 -0
- data/lib/kitchen/provisioner/chef_apply.rb +0 -0
- data/lib/kitchen/provisioner/chef_base.rb +96 -0
- data/lib/kitchen/provisioner/chef_solo.rb +0 -0
- data/lib/kitchen/provisioner/chef_zero.rb +0 -0
- data/lib/kitchen/provisioner/dummy.rb +0 -0
- data/lib/kitchen/provisioner/shell.rb +0 -0
- data/lib/kitchen/rake_tasks.rb +0 -0
- data/lib/kitchen/shell_out.rb +0 -0
- data/lib/kitchen/ssh.rb +0 -0
- data/lib/kitchen/state_file.rb +3 -3
- data/lib/kitchen/suite.rb +0 -0
- data/lib/kitchen/thor_tasks.rb +0 -0
- data/lib/kitchen/transport.rb +0 -0
- data/lib/kitchen/transport/base.rb +13 -1
- data/lib/kitchen/transport/dummy.rb +4 -0
- data/lib/kitchen/transport/exec.rb +0 -0
- data/lib/kitchen/transport/ssh.rb +71 -9
- data/lib/kitchen/transport/winrm.rb +16 -0
- data/lib/kitchen/util.rb +0 -0
- data/lib/kitchen/verifier.rb +0 -0
- data/lib/kitchen/verifier/base.rb +0 -0
- data/lib/kitchen/verifier/busser.rb +0 -0
- data/lib/kitchen/verifier/dummy.rb +0 -0
- data/lib/kitchen/verifier/shell.rb +0 -0
- data/lib/kitchen/version.rb +1 -1
- data/lib/vendor/hash_recursive_merge.rb +0 -0
- data/spec/kitchen/base64_stream_spec.rb +0 -0
- data/spec/kitchen/cli_spec.rb +0 -0
- data/spec/kitchen/collection_spec.rb +0 -0
- data/spec/kitchen/color_spec.rb +0 -0
- data/spec/kitchen/config_spec.rb +0 -0
- data/spec/kitchen/configurable_spec.rb +0 -0
- data/spec/kitchen/data_munger_spec.rb +0 -0
- data/spec/kitchen/diagnostic_spec.rb +0 -0
- data/spec/kitchen/driver/base_spec.rb +0 -0
- data/spec/kitchen/driver/dummy_spec.rb +0 -0
- data/spec/kitchen/driver/exec_spec.rb +0 -0
- data/spec/kitchen/driver/proxy_spec.rb +0 -0
- data/spec/kitchen/driver/ssh_base_spec.rb +42 -1
- data/spec/kitchen/driver_spec.rb +0 -0
- data/spec/kitchen/errors_spec.rb +0 -0
- data/spec/kitchen/instance_spec.rb +0 -0
- data/spec/kitchen/lazy_hash_spec.rb +0 -0
- data/spec/kitchen/loader/yaml_spec.rb +2 -6
- data/spec/kitchen/logger_spec.rb +0 -0
- data/spec/kitchen/logging_spec.rb +0 -0
- data/spec/kitchen/login_command_spec.rb +0 -0
- data/spec/kitchen/metadata_chopper_spec.rb +0 -0
- data/spec/kitchen/platform_spec.rb +0 -0
- data/spec/kitchen/provisioner/base_spec.rb +25 -0
- data/spec/kitchen/provisioner/chef/policyfile_spec.rb +0 -0
- data/spec/kitchen/provisioner/chef_apply_spec.rb +0 -0
- data/spec/kitchen/provisioner/chef_base_spec.rb +28 -0
- data/spec/kitchen/provisioner/chef_solo_spec.rb +0 -0
- data/spec/kitchen/provisioner/chef_zero_spec.rb +0 -0
- data/spec/kitchen/provisioner/dummy_spec.rb +0 -0
- data/spec/kitchen/provisioner/shell_spec.rb +0 -0
- data/spec/kitchen/provisioner_spec.rb +0 -0
- data/spec/kitchen/shell_out_spec.rb +0 -0
- data/spec/kitchen/ssh_spec.rb +0 -0
- data/spec/kitchen/state_file_spec.rb +1 -3
- data/spec/kitchen/suite_spec.rb +0 -0
- data/spec/kitchen/transport/base_spec.rb +17 -0
- data/spec/kitchen/transport/exec_spec.rb +0 -0
- data/spec/kitchen/transport/ssh_spec.rb +111 -0
- data/spec/kitchen/transport/winrm_spec.rb +0 -0
- data/spec/kitchen/transport_spec.rb +0 -0
- data/spec/kitchen/util_spec.rb +0 -0
- data/spec/kitchen/verifier/base_spec.rb +0 -0
- data/spec/kitchen/verifier/busser_spec.rb +0 -0
- data/spec/kitchen/verifier/dummy_spec.rb +0 -0
- data/spec/kitchen/verifier/shell_spec.rb +0 -0
- data/spec/kitchen/verifier_spec.rb +0 -0
- data/spec/kitchen_spec.rb +0 -0
- data/spec/spec_helper.rb +0 -0
- data/spec/support/powershell_max_size_spec.rb +0 -0
- data/support/busser_install_command.ps1 +0 -0
- data/support/busser_install_command.sh +0 -0
- data/support/chef-client-fail-if-update-handler.rb +0 -0
- data/support/chef_base_init_command.ps1 +0 -0
- data/support/chef_base_init_command.sh +0 -0
- data/support/chef_base_install_command.ps1 +0 -0
- data/support/chef_base_install_command.sh +0 -0
- data/support/chef_zero_prepare_command_legacy.ps1 +0 -0
- data/support/chef_zero_prepare_command_legacy.sh +0 -0
- data/support/download_helpers.sh +0 -0
- data/support/dummy-validation.pem +0 -0
- data/templates/driver/CHANGELOG.md.erb +0 -0
- data/templates/driver/Gemfile.erb +0 -0
- data/templates/driver/README.md.erb +0 -0
- data/templates/driver/Rakefile.erb +0 -0
- data/templates/driver/driver.rb.erb +0 -0
- data/templates/driver/gemspec.erb +0 -0
- data/templates/driver/gitignore.erb +0 -0
- data/templates/driver/license_apachev2.erb +0 -0
- data/templates/driver/license_lgplv3.erb +0 -0
- data/templates/driver/license_mit.erb +0 -0
- data/templates/driver/license_reserved.erb +0 -0
- data/templates/driver/tailor.erb +0 -0
- data/templates/driver/travis.yml.erb +0 -0
- data/templates/driver/version.rb.erb +0 -0
- data/templates/init/chefignore.erb +0 -0
- data/templates/init/kitchen.yml.erb +0 -0
- data/test-kitchen.gemspec +1 -2
- data/test/cookbooks/test_cookbook/metadata.rb +0 -0
- data/test/cookbooks/test_cookbook/recipes/default.rb +0 -0
- data/test/integration/default/default_spec.rb +0 -0
- data/testing_windows.md +0 -0
- metadata +8 -16
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3347ab6b20b7e1ec694d6fa3d050694253dcc9b1
|
|
4
|
+
data.tar.gz: dc5c2281fb606f23c941ea86554d51d45a18deb9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8fc1efddb69de36cb94b465377edc773f0aa24c133b80133ead971090abb03d92eb747a1e9e739fdb802f5d170ffb18bc486bb2b07ad8d80ba73097548d8a120
|
|
7
|
+
data.tar.gz: ea3ce216891dcde776bef616fed38dce086552d1ea46bfd38278bfe85de2b0a37b58b2ad333a6bd7cf66044c1c8d3e84033ede36b64a6b69a97d0db4f1a0a983
|
data/.gitattributes
CHANGED
|
File without changes
|
data/.github/ISSUE_TEMPLATE.md
CHANGED
|
File without changes
|
data/.gitignore
CHANGED
data/.kitchen.ci.yml
CHANGED
|
File without changes
|
data/.kitchen.dokken.yml
CHANGED
|
File without changes
|
data/.kitchen.proxy.yml
CHANGED
|
File without changes
|
data/.rubocop.yml
CHANGED
|
File without changes
|
data/.travis.yml
CHANGED
|
File without changes
|
data/.yardopts
CHANGED
|
File without changes
|
data/Berksfile
CHANGED
|
File without changes
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,71 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## [v1.20.0](https://github.com/test-kitchen/test-kitchen/tree/v1.20.0) (2018-01-19)
|
|
4
|
+
[Full Changelog](https://github.com/test-kitchen/test-kitchen/compare/v1.19.2...v1.20.0)
|
|
5
|
+
|
|
6
|
+
**Release Notes:**
|
|
7
|
+
|
|
8
|
+
#### Multiple paths for data_bags
|
|
9
|
+
|
|
10
|
+
Allows a user to use data_bags from an array of directories
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
data_bags_path:
|
|
14
|
+
- 'data_bags'
|
|
15
|
+
- 'test/integrations/data_bags'
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
#### Deprecation Warnings for Configuration Keys
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
$ kitchen list default-centos-7
|
|
22
|
+
$$$$$$ Deprecated configuration detected:
|
|
23
|
+
require_chef_omnibus
|
|
24
|
+
Run 'kitchen doctor' for details.
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
$ kitchen doctor
|
|
29
|
+
$$$$$$ Deprecated configuration detected:
|
|
30
|
+
require_chef_omnibus
|
|
31
|
+
Run 'kitchen doctor' for details.
|
|
32
|
+
|
|
33
|
+
-----> The doctor is in
|
|
34
|
+
**** require_chef_omnibus deprecated
|
|
35
|
+
The 'require_chef_omnibus' attribute with version values will change
|
|
36
|
+
to use the new 'product_version' attribute.
|
|
37
|
+
|
|
38
|
+
Note: 'product_name' must be set in order to use 'product_version'
|
|
39
|
+
until 'product_name' replaces 'require_chef_omnibus' as the default.
|
|
40
|
+
|
|
41
|
+
# New Usage #
|
|
42
|
+
provisioner:
|
|
43
|
+
product_name: <chef or chefdk>
|
|
44
|
+
product_version: 12.0.3
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
#### SSH via an HTTP Proxy
|
|
48
|
+
|
|
49
|
+
This allows configuring the SSH transport to utilize an HTTP Proxy. The following configuration keys have been added to `transport`:
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
ssh_http_proxy_user
|
|
53
|
+
ssh_http_proxy_password
|
|
54
|
+
ssh_http_proxy_port
|
|
55
|
+
ssh_http_proxy
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
**Merged pull requests:**
|
|
59
|
+
|
|
60
|
+
- Support multiple paths for data bags [\#1313](https://github.com/test-kitchen/test-kitchen/pull/1313) ([thomasdziedzic](https://github.com/thomasdziedzic))
|
|
61
|
+
- Support for configuration deprecation warnings [\#1303](https://github.com/test-kitchen/test-kitchen/pull/1303) ([wrightp](https://github.com/wrightp))
|
|
62
|
+
- Support for SSH via an HTTP Proxy [\#1329](https://github.com/test-kitchen/test-kitchen/pull/1329) ([NAshwini](https://github.com/NAshwini))
|
|
63
|
+
- Add download support to the base transport and provisioner [\#1306](https://github.com/test-kitchen/test-kitchen/pull/1306) ([atheiman](https://github.com/atheiman))
|
|
64
|
+
- Fix download support for WinRM [\#1338](https://github.com/test-kitchen/test-kitchen/pull/1338) ([gtmanfred](https://github.com/gtmanfred))
|
|
65
|
+
- Fix code to validate retry\_on\_exit\_code [\#1312](https://github.com/test-kitchen/test-kitchen/pull/1312) ([NAshwini](https://github.com/NAshwini))
|
|
66
|
+
- Remove safe\_yaml [\#1328](https://github.com/test-kitchen/test-kitchen/pull/1328) ([coderanger](https://github.com/coderanger))
|
|
67
|
+
- Pin minitest to 5.11 [\#1339](https://github.com/test-kitchen/test-kitchen/pull/1339) ([cheeseplus](https://github.com/cheeseplus))
|
|
68
|
+
|
|
3
69
|
## [v1.19.2](https://github.com/test-kitchen/test-kitchen/tree/v1.19.2) (2017-11-28)
|
|
4
70
|
[Full Changelog](https://github.com/test-kitchen/test-kitchen/compare/v1.19.1...v1.19.2)
|
|
5
71
|
|
data/CONTRIBUTING.md
CHANGED
|
File without changes
|
data/ECOSYSTEM.md
CHANGED
|
File without changes
|
data/Gemfile
CHANGED
|
File without changes
|
data/Gemfile.proxy_tests
CHANGED
|
File without changes
|
data/Guardfile
CHANGED
|
File without changes
|
data/LICENSE
CHANGED
|
File without changes
|
data/MAINTAINERS.md
CHANGED
|
File without changes
|
data/README.md
CHANGED
|
File without changes
|
data/Rakefile
CHANGED
|
File without changes
|
data/appveyor.yml
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/features/support/env.rb
CHANGED
|
File without changes
|
data/lib/kitchen.rb
CHANGED
|
File without changes
|
|
File without changes
|
data/lib/kitchen/cli.rb
CHANGED
|
File without changes
|
data/lib/kitchen/collection.rb
CHANGED
|
File without changes
|
data/lib/kitchen/color.rb
CHANGED
|
File without changes
|
data/lib/kitchen/command.rb
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/lib/kitchen/command/exec.rb
CHANGED
|
File without changes
|
data/lib/kitchen/command/list.rb
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/lib/kitchen/command/sink.rb
CHANGED
|
File without changes
|
data/lib/kitchen/command/test.rb
CHANGED
|
File without changes
|
data/lib/kitchen/config.rb
CHANGED
|
File without changes
|
data/lib/kitchen/configurable.rb
CHANGED
|
@@ -48,6 +48,7 @@ module Kitchen
|
|
|
48
48
|
|
|
49
49
|
@instance = instance
|
|
50
50
|
expand_paths!
|
|
51
|
+
deprecate_config!
|
|
51
52
|
validate_config!
|
|
52
53
|
load_needed_dependencies!
|
|
53
54
|
|
|
@@ -180,6 +181,14 @@ module Kitchen
|
|
|
180
181
|
# @api private
|
|
181
182
|
attr_reader :config
|
|
182
183
|
|
|
184
|
+
# @return [Hash] a hash of the detected deprecated config attributes
|
|
185
|
+
# @api private
|
|
186
|
+
attr_reader :deprecated_config
|
|
187
|
+
|
|
188
|
+
# @return [Hash] user provided configuration hash
|
|
189
|
+
# @api private
|
|
190
|
+
attr_reader :provided_config
|
|
191
|
+
|
|
183
192
|
# Initializes an internal configuration hash. The hash may contain
|
|
184
193
|
# callable blocks as values that are meant to be called lazily. This
|
|
185
194
|
# method is intended to be included in an object's .initialize method.
|
|
@@ -188,6 +197,7 @@ module Kitchen
|
|
|
188
197
|
# @api private
|
|
189
198
|
def init_config(config)
|
|
190
199
|
@config = LazyHash.new(config, self)
|
|
200
|
+
@provided_config = config.dup
|
|
191
201
|
self.class.defaults.each do |attr, value|
|
|
192
202
|
@config[attr] = value unless @config.key?(attr)
|
|
193
203
|
end
|
|
@@ -213,6 +223,32 @@ module Kitchen
|
|
|
213
223
|
end
|
|
214
224
|
end
|
|
215
225
|
|
|
226
|
+
# Initialize detected deprecated configuration hash.
|
|
227
|
+
# Display warning if deprecations have been detected.
|
|
228
|
+
#
|
|
229
|
+
# @api private
|
|
230
|
+
def deprecate_config!
|
|
231
|
+
# We only want to display the deprecation list of config values once per execution on the default config.
|
|
232
|
+
# This prevents the output of deprecations from being printed for each permutation of test suites.
|
|
233
|
+
return if defined? @@has_been_warned_of_deprecations
|
|
234
|
+
|
|
235
|
+
deprecated_attributes = LazyHash.new(self.class.deprecated_attributes, self)
|
|
236
|
+
# Remove items from hash when not provided in the loaded config or when the rendered message is nil
|
|
237
|
+
@deprecated_config = deprecated_attributes.delete_if { |attr, obj| !provided_config.key?(attr) || obj.nil? }
|
|
238
|
+
|
|
239
|
+
if !deprecated_config.empty?
|
|
240
|
+
warning = Util.outdent!(<<-MSG)
|
|
241
|
+
Deprecated configuration detected:
|
|
242
|
+
#{deprecated_config.keys.join("\n")}
|
|
243
|
+
Run 'kitchen doctor' for details.
|
|
244
|
+
MSG
|
|
245
|
+
warn(warning)
|
|
246
|
+
|
|
247
|
+
# Set global var that the deprecation message has been printed
|
|
248
|
+
@@has_been_warned_of_deprecations = true
|
|
249
|
+
end
|
|
250
|
+
end
|
|
251
|
+
|
|
216
252
|
# Loads any required third party Ruby libraries or runs any shell out
|
|
217
253
|
# commands to prepare the plugin. This method will be called in the
|
|
218
254
|
# context of the main thread of execution and so does not necessarily
|
|
@@ -451,6 +487,26 @@ module Kitchen
|
|
|
451
487
|
expanded_paths[attr] = block_given? ? block : value
|
|
452
488
|
end
|
|
453
489
|
|
|
490
|
+
# Set the appropriate deprecation message for a given attribute name
|
|
491
|
+
#
|
|
492
|
+
# @example the default usage
|
|
493
|
+
#
|
|
494
|
+
# deprecate_config_for :attribute_name, "Detailed deprecation message."
|
|
495
|
+
#
|
|
496
|
+
# @example using a block
|
|
497
|
+
#
|
|
498
|
+
# deprecate_config_for :attribute_name do |subject|
|
|
499
|
+
# "Detailed deprecation message." if subject == true
|
|
500
|
+
# end
|
|
501
|
+
#
|
|
502
|
+
# @param attr [String] configuration attribute name
|
|
503
|
+
# @param value [Object, nil] static default value for attribute
|
|
504
|
+
# @yieldparam object [Object] a reference to the instantiated object
|
|
505
|
+
# @yieldreturn [Object, nil] dynamically computed value for the attribute
|
|
506
|
+
def deprecate_config_for(attr, value = nil, &block)
|
|
507
|
+
deprecated_attributes[attr] = block_given? ? block : value
|
|
508
|
+
end
|
|
509
|
+
|
|
454
510
|
# Ensures that an attribute must have a non-nil, non-empty String value.
|
|
455
511
|
# The default behavior will be to raise a user error and thereby halting
|
|
456
512
|
# further configuration processing. Good use cases for require_config
|
|
@@ -520,6 +576,18 @@ module Kitchen
|
|
|
520
576
|
end
|
|
521
577
|
end
|
|
522
578
|
|
|
579
|
+
def deprecated_attributes
|
|
580
|
+
@deprecated_attributes ||= {}.merge(super_deprecated_attributes)
|
|
581
|
+
end
|
|
582
|
+
|
|
583
|
+
def super_deprecated_attributes
|
|
584
|
+
if superclass.respond_to?(:deprecated_attributes)
|
|
585
|
+
superclass.deprecated_attributes
|
|
586
|
+
else
|
|
587
|
+
{}
|
|
588
|
+
end
|
|
589
|
+
end
|
|
590
|
+
|
|
523
591
|
# @return [Hash] a hash of attribute keys and valudation callable blocks
|
|
524
592
|
# which has been merged with any superclass valudations
|
|
525
593
|
# @api private
|
data/lib/kitchen/data_munger.rb
CHANGED
|
File without changes
|
data/lib/kitchen/diagnostic.rb
CHANGED
|
File without changes
|
data/lib/kitchen/driver.rb
CHANGED
|
File without changes
|
data/lib/kitchen/driver/base.rb
CHANGED
|
File without changes
|
data/lib/kitchen/driver/dummy.rb
CHANGED
|
File without changes
|
data/lib/kitchen/driver/exec.rb
CHANGED
|
File without changes
|
data/lib/kitchen/driver/proxy.rb
CHANGED
|
File without changes
|
|
@@ -80,6 +80,12 @@ module Kitchen
|
|
|
80
80
|
debug("Transfer complete")
|
|
81
81
|
conn.execute(env_cmd(provisioner.prepare_command))
|
|
82
82
|
conn.execute(env_cmd(provisioner.run_command))
|
|
83
|
+
info("Downloading files from #{instance.to_str}")
|
|
84
|
+
provisioner[:downloads].to_h.each do |remotes, local|
|
|
85
|
+
debug("Downloading #{Array(remotes).join(', ')} to #{local}")
|
|
86
|
+
conn.download(remotes, local)
|
|
87
|
+
end
|
|
88
|
+
debug("Download complete")
|
|
83
89
|
end
|
|
84
90
|
rescue Kitchen::Transport::TransportFailed => ex
|
|
85
91
|
raise ActionFailed, ex.message
|
data/lib/kitchen/errors.rb
CHANGED
|
File without changes
|
|
File without changes
|
data/lib/kitchen/instance.rb
CHANGED
|
File without changes
|
data/lib/kitchen/lazy_hash.rb
CHANGED
|
@@ -124,6 +124,14 @@ module Kitchen
|
|
|
124
124
|
to_hash.each(&block)
|
|
125
125
|
end
|
|
126
126
|
|
|
127
|
+
# Returns a new Hash after deleting the key-value pairs for which the block
|
|
128
|
+
# returns true.
|
|
129
|
+
#
|
|
130
|
+
# @return [Hash] a new hash
|
|
131
|
+
def delete_if(&block)
|
|
132
|
+
to_hash.delete_if(&block)
|
|
133
|
+
end
|
|
134
|
+
|
|
127
135
|
private
|
|
128
136
|
|
|
129
137
|
# Returns an object or invokes call with context if object is callable.
|
data/lib/kitchen/loader/yaml.rb
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
require "erb"
|
|
20
20
|
require "vendor/hash_recursive_merge"
|
|
21
|
-
require "
|
|
21
|
+
require "yaml"
|
|
22
22
|
|
|
23
23
|
module Kitchen
|
|
24
24
|
module Loader
|
|
@@ -322,7 +322,7 @@ module Kitchen
|
|
|
322
322
|
def parse_yaml_string(string, file_name)
|
|
323
323
|
return {} if string.nil? || string.empty?
|
|
324
324
|
|
|
325
|
-
result =
|
|
325
|
+
result = ::YAML.safe_load(string, [Symbol]) || {}
|
|
326
326
|
unless result.is_a?(Hash)
|
|
327
327
|
raise UserError, "Error parsing #{file_name} as YAML " \
|
|
328
328
|
"(Result of parse was not a Hash, but was a #{result.class}).\n" \
|
|
@@ -330,7 +330,7 @@ module Kitchen
|
|
|
330
330
|
"debug your issue."
|
|
331
331
|
end
|
|
332
332
|
result
|
|
333
|
-
rescue SyntaxError, Psych::SyntaxError
|
|
333
|
+
rescue SyntaxError, Psych::SyntaxError, Psych::DisallowedClass
|
|
334
334
|
raise UserError, "Error parsing #{file_name} as YAML.\n" \
|
|
335
335
|
"Please run `kitchen diagnose --no-instances --loader' to help " \
|
|
336
336
|
"debug your issue."
|
data/lib/kitchen/logger.rb
CHANGED
|
File without changes
|
data/lib/kitchen/logging.rb
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/lib/kitchen/platform.rb
CHANGED
|
File without changes
|
data/lib/kitchen/provisioner.rb
CHANGED
|
File without changes
|
|
@@ -47,6 +47,8 @@ module Kitchen
|
|
|
47
47
|
|
|
48
48
|
default_config :command_prefix, nil
|
|
49
49
|
|
|
50
|
+
default_config :downloads, {}
|
|
51
|
+
|
|
50
52
|
expand_path_for :test_base_path
|
|
51
53
|
|
|
52
54
|
# Constructs a new provisioner by providing a configuration hash.
|
|
@@ -78,6 +80,12 @@ module Kitchen
|
|
|
78
80
|
config[:max_retries],
|
|
79
81
|
config[:wait_for_retry]
|
|
80
82
|
)
|
|
83
|
+
info("Downloading files from #{instance.to_str}")
|
|
84
|
+
config[:downloads].to_h.each do |remotes, local|
|
|
85
|
+
debug("Downloading #{Array(remotes).join(', ')} to #{local}")
|
|
86
|
+
conn.download(remotes, local)
|
|
87
|
+
end
|
|
88
|
+
debug("Download complete")
|
|
81
89
|
end
|
|
82
90
|
rescue Kitchen::Transport::TransportFailed => ex
|
|
83
91
|
raise ActionFailed, ex.message
|
|
File without changes
|
|
@@ -234,7 +234,11 @@ module Kitchen
|
|
|
234
234
|
case opts[:type]
|
|
235
235
|
when :directory
|
|
236
236
|
FileUtils.mkdir_p(dest)
|
|
237
|
-
|
|
237
|
+
if src.kind_of?(Array)
|
|
238
|
+
src.each { |x| FileUtils.cp_r(Util.list_directory(x), dest) }
|
|
239
|
+
else
|
|
240
|
+
FileUtils.cp_r(Util.list_directory(src), dest)
|
|
241
|
+
end
|
|
238
242
|
when :file
|
|
239
243
|
FileUtils.mkdir_p(File.dirname(dest))
|
|
240
244
|
FileUtils.cp_r(src, dest)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -136,6 +136,91 @@ module Kitchen
|
|
|
136
136
|
|
|
137
137
|
default_config :checksum
|
|
138
138
|
|
|
139
|
+
deprecate_config_for :require_chef_omnibus do |provisioner|
|
|
140
|
+
case
|
|
141
|
+
when provisioner[:require_chef_omnibus] == false
|
|
142
|
+
Util.outdent!(<<-MSG)
|
|
143
|
+
The 'require_chef_omnibus' attribute with value of 'false' will
|
|
144
|
+
change to use the new 'install_strategy' attribute with a value of 'skip'.
|
|
145
|
+
|
|
146
|
+
Note: 'product_name' must be set in order to use 'install_strategy'.
|
|
147
|
+
Although this seems counterintuitive, it is necessary until
|
|
148
|
+
'product_name' replaces 'require_chef_omnibus' as the default.
|
|
149
|
+
|
|
150
|
+
# New Usage #
|
|
151
|
+
provisioner:
|
|
152
|
+
product_name: <chef or chefdk>
|
|
153
|
+
install_strategy: skip
|
|
154
|
+
MSG
|
|
155
|
+
when provisioner[:require_chef_omnibus].to_s.match(/\d/)
|
|
156
|
+
Util.outdent!(<<-MSG)
|
|
157
|
+
The 'require_chef_omnibus' attribute with version values will change
|
|
158
|
+
to use the new 'product_version' attribute.
|
|
159
|
+
|
|
160
|
+
Note: 'product_name' must be set in order to use 'product_version'
|
|
161
|
+
until 'product_name' replaces 'require_chef_omnibus' as the default.
|
|
162
|
+
|
|
163
|
+
# New Usage #
|
|
164
|
+
provisioner:
|
|
165
|
+
product_name: <chef or chefdk>
|
|
166
|
+
product_version: #{provisioner[:require_chef_omnibus]}
|
|
167
|
+
MSG
|
|
168
|
+
when provisioner[:require_chef_omnibus] == "latest"
|
|
169
|
+
Util.outdent!(<<-MSG)
|
|
170
|
+
The 'require_chef_omnibus' attribute with value of 'latest' will change
|
|
171
|
+
to use the new 'install_strategy' attribute with a value of 'always'.
|
|
172
|
+
|
|
173
|
+
Note: 'product_name' must be set in order to use 'install_strategy'
|
|
174
|
+
until 'product_name' replaces 'require_chef_omnibus' as the default.
|
|
175
|
+
|
|
176
|
+
# New Usage #
|
|
177
|
+
provisioner:
|
|
178
|
+
product_name: <chef or chefdk>
|
|
179
|
+
install_strategy: always
|
|
180
|
+
MSG
|
|
181
|
+
end
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
deprecate_config_for :chef_omnibus_url, Util.outdent!(<<-MSG)
|
|
185
|
+
Changing the 'chef_omnibus_url' attribute breaks existing functionality. It will
|
|
186
|
+
be removed in a future version.
|
|
187
|
+
MSG
|
|
188
|
+
|
|
189
|
+
deprecate_config_for :chef_omnibus_install_options, Util.outdent!(<<-MSG)
|
|
190
|
+
The 'chef_omnibus_install_options' attribute will be replaced by using
|
|
191
|
+
'product_name' and 'channel' attributes.
|
|
192
|
+
|
|
193
|
+
Note: 'product_name' must be set in order to use 'channel'
|
|
194
|
+
until 'product_name' replaces 'require_chef_omnibus' as the default.
|
|
195
|
+
|
|
196
|
+
# Deprecated Example #
|
|
197
|
+
provisioner:
|
|
198
|
+
chef_omnibus_install_options: -P chefdk -c current
|
|
199
|
+
|
|
200
|
+
# New Usage #
|
|
201
|
+
provisioner:
|
|
202
|
+
product_name: chefdk
|
|
203
|
+
channel: current
|
|
204
|
+
MSG
|
|
205
|
+
|
|
206
|
+
deprecate_config_for :install_msi_url, Util.outdent!(<<-MSG)
|
|
207
|
+
The 'install_msi_url' will be relaced by the 'download_url' attribute.
|
|
208
|
+
'download_url' will be applied to Bourne and Powershell download scripts.
|
|
209
|
+
|
|
210
|
+
Note: 'product_name' must be set in order to use 'download_url'
|
|
211
|
+
until 'product_name' replaces 'require_chef_omnibus' as the default.
|
|
212
|
+
|
|
213
|
+
# New Usage #
|
|
214
|
+
provisioner:
|
|
215
|
+
product_name: <chef or chefdk>
|
|
216
|
+
download_url: http://direct-download-url
|
|
217
|
+
MSG
|
|
218
|
+
|
|
219
|
+
deprecate_config_for :chef_metadata_url, Util.outdent!(<<-MSG)
|
|
220
|
+
The 'chef_metadata_url' will be removed. The Windows metadata URL will be
|
|
221
|
+
fully managed by using attribute settings.
|
|
222
|
+
MSG
|
|
223
|
+
|
|
139
224
|
# Reads the local Chef::Config object (if present). We do this because
|
|
140
225
|
# we want to start bring Chef config and ChefDK tool config closer
|
|
141
226
|
# together. For example, we want to configure proxy settings in 1
|
|
@@ -153,6 +238,12 @@ module Kitchen
|
|
|
153
238
|
ChefConfig::Config.export_proxies if defined?(ChefConfig::Config.export_proxies)
|
|
154
239
|
end
|
|
155
240
|
|
|
241
|
+
def doctor(state)
|
|
242
|
+
deprecated_config.each do |attr, msg|
|
|
243
|
+
info("**** #{attr} deprecated\n#{msg}")
|
|
244
|
+
end
|
|
245
|
+
end
|
|
246
|
+
|
|
156
247
|
# (see Base#create_sandbox)
|
|
157
248
|
def create_sandbox
|
|
158
249
|
super
|
|
@@ -380,6 +471,11 @@ module Kitchen
|
|
|
380
471
|
opts[:install_command_options][:checksum] = config[:checksum] if config[:checksum]
|
|
381
472
|
end
|
|
382
473
|
|
|
474
|
+
if instance.driver.cache_directory
|
|
475
|
+
download_dir_option = windows_os? ? :download_directory : :cmdline_dl_dir
|
|
476
|
+
opts[:install_command_options][download_dir_option] = instance.driver.cache_directory
|
|
477
|
+
end
|
|
478
|
+
|
|
383
479
|
proxies = {}.tap do |prox|
|
|
384
480
|
[:http_proxy, :https_proxy, :ftp_proxy, :no_proxy].each do |key|
|
|
385
481
|
prox[key] = config[key] if config[key]
|