test-kitchen 1.20.0 → 1.21.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 +5 -5
- data/.gitattributes +0 -0
- data/.github/ISSUE_TEMPLATE.md +0 -0
- data/.gitignore +0 -0
- data/.kitchen.ci.yml +0 -0
- data/.kitchen.dokken.yml +0 -0
- data/.kitchen.proxy.yml +1 -1
- data/.rubocop.yml +1 -1
- data/.travis.yml +6 -2
- data/.yardopts +0 -0
- data/Berksfile +0 -0
- data/CHANGELOG.md +26 -0
- data/CONTRIBUTING.md +0 -0
- data/ECOSYSTEM.md +0 -0
- data/Gemfile +6 -2
- 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 +4 -3
- 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 +2 -2
- data/features/kitchen_diagnose_command.feature +0 -0
- data/features/kitchen_help_command.feature +0 -0
- data/features/kitchen_init_command.feature +19 -39
- data/features/kitchen_list_command.feature +3 -3
- 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 -12
- 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 +15 -11
- data/lib/kitchen/collection.rb +0 -0
- data/lib/kitchen/color.rb +0 -0
- data/lib/kitchen/command.rb +1 -1
- 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 +1 -1
- data/lib/kitchen/configurable.rb +0 -0
- data/lib/kitchen/data_munger.rb +10 -10
- 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 +1 -1
- data/lib/kitchen/driver/proxy.rb +1 -1
- data/lib/kitchen/driver/ssh_base.rb +0 -0
- data/lib/kitchen/errors.rb +0 -0
- data/lib/kitchen/generator/init.rb +1 -36
- data/lib/kitchen/instance.rb +0 -0
- data/lib/kitchen/lazy_hash.rb +1 -1
- data/lib/kitchen/loader/yaml.rb +31 -6
- data/lib/kitchen/logger.rb +1 -1
- 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 +0 -0
- data/lib/kitchen/provisioner/chef/berkshelf.rb +23 -19
- data/lib/kitchen/provisioner/chef/common_sandbox.rb +0 -0
- data/lib/kitchen/provisioner/chef/librarian.rb +25 -21
- data/lib/kitchen/provisioner/chef/policyfile.rb +23 -18
- data/lib/kitchen/provisioner/chef_apply.rb +2 -2
- data/lib/kitchen/provisioner/chef_base.rb +3 -2
- data/lib/kitchen/provisioner/chef_solo.rb +1 -1
- 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 +0 -0
- 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 +0 -0
- data/lib/kitchen/transport/dummy.rb +0 -0
- data/lib/kitchen/transport/exec.rb +0 -0
- data/lib/kitchen/transport/ssh.rb +0 -0
- data/lib/kitchen/transport/winrm.rb +11 -5
- 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 +0 -0
- 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 +43 -0
- data/spec/kitchen/logger_spec.rb +6 -1
- 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 +0 -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 +6 -6
- 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 +0 -0
- data/spec/kitchen/suite_spec.rb +0 -0
- data/spec/kitchen/transport/base_spec.rb +0 -0
- data/spec/kitchen/transport/exec_spec.rb +0 -0
- data/spec/kitchen/transport/ssh_spec.rb +0 -0
- data/spec/kitchen/transport/winrm_spec.rb +22 -13
- 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 +2 -2
- data/test-kitchen.gemspec +1 -1
- 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 +5 -5
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
|
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
|
@@ -39,7 +39,7 @@ module Kitchen
|
|
|
39
39
|
#
|
|
40
40
|
# @example fetching an instance by name
|
|
41
41
|
#
|
|
42
|
-
# Kitchen::Config.new.instances.get("default-ubuntu-
|
|
42
|
+
# Kitchen::Config.new.instances.get("default-ubuntu-16.04")
|
|
43
43
|
#
|
|
44
44
|
# @example fetching all instances matching a regular expression
|
|
45
45
|
#
|
data/lib/kitchen/configurable.rb
CHANGED
|
File without changes
|
data/lib/kitchen/data_munger.rb
CHANGED
|
@@ -151,7 +151,7 @@ module Kitchen
|
|
|
151
151
|
#
|
|
152
152
|
# :platforms => [
|
|
153
153
|
# {
|
|
154
|
-
# :name => "ubuntu-
|
|
154
|
+
# :name => "ubuntu-16.04",
|
|
155
155
|
# :busser => "bar"
|
|
156
156
|
# }
|
|
157
157
|
# ],
|
|
@@ -174,7 +174,7 @@ module Kitchen
|
|
|
174
174
|
#
|
|
175
175
|
# :platforms => [
|
|
176
176
|
# {
|
|
177
|
-
# :name => "ubuntu-
|
|
177
|
+
# :name => "ubuntu-16.04",
|
|
178
178
|
# :verifier => {
|
|
179
179
|
# :name => "busser",
|
|
180
180
|
# :version => "bar
|
|
@@ -295,7 +295,7 @@ module Kitchen
|
|
|
295
295
|
#
|
|
296
296
|
# :platforms => [
|
|
297
297
|
# {
|
|
298
|
-
# :name => "ubuntu-
|
|
298
|
+
# :name => "ubuntu-16.04",
|
|
299
299
|
# :driver_plugin => "bar"
|
|
300
300
|
# }
|
|
301
301
|
# ],
|
|
@@ -319,7 +319,7 @@ module Kitchen
|
|
|
319
319
|
#
|
|
320
320
|
# :platforms => [
|
|
321
321
|
# {
|
|
322
|
-
# :name => "ubuntu-
|
|
322
|
+
# :name => "ubuntu-16.04",
|
|
323
323
|
# :driver => {
|
|
324
324
|
# :name => "bar"
|
|
325
325
|
# }
|
|
@@ -391,7 +391,7 @@ module Kitchen
|
|
|
391
391
|
#
|
|
392
392
|
# :platforms => [
|
|
393
393
|
# {
|
|
394
|
-
# :name => "ubuntu-
|
|
394
|
+
# :name => "ubuntu-16.04",
|
|
395
395
|
# :driver => {
|
|
396
396
|
# :http_proxy => "foo"
|
|
397
397
|
# }
|
|
@@ -428,7 +428,7 @@ module Kitchen
|
|
|
428
428
|
#
|
|
429
429
|
# :platforms => [
|
|
430
430
|
# {
|
|
431
|
-
# :name => "ubuntu-
|
|
431
|
+
# :name => "ubuntu-16.04",
|
|
432
432
|
# :driver => {
|
|
433
433
|
# :http_proxy => "foo"
|
|
434
434
|
# },
|
|
@@ -512,7 +512,7 @@ module Kitchen
|
|
|
512
512
|
#
|
|
513
513
|
# :platforms => [
|
|
514
514
|
# {
|
|
515
|
-
# :name => "ubuntu-
|
|
515
|
+
# :name => "ubuntu-16.04",
|
|
516
516
|
# :driver => {
|
|
517
517
|
# :require_chef_omnibus => "10.8.2"
|
|
518
518
|
# }
|
|
@@ -538,7 +538,7 @@ module Kitchen
|
|
|
538
538
|
#
|
|
539
539
|
# :platforms => [
|
|
540
540
|
# {
|
|
541
|
-
# :name => "ubuntu-
|
|
541
|
+
# :name => "ubuntu-16.04",
|
|
542
542
|
# :provisioner => {
|
|
543
543
|
# :require_chef_omnibus => "10.8.2"
|
|
544
544
|
# }
|
|
@@ -635,7 +635,7 @@ module Kitchen
|
|
|
635
635
|
# {
|
|
636
636
|
# :platforms => [
|
|
637
637
|
# {
|
|
638
|
-
# :name => "ubuntu-
|
|
638
|
+
# :name => "ubuntu-16.04",
|
|
639
639
|
# :attributes => { :one => "two" },
|
|
640
640
|
# :run_list => ["alpha", "bravo"]
|
|
641
641
|
# }
|
|
@@ -655,7 +655,7 @@ module Kitchen
|
|
|
655
655
|
# {
|
|
656
656
|
# :platforms => [
|
|
657
657
|
# {
|
|
658
|
-
# :name => "ubuntu-
|
|
658
|
+
# :name => "ubuntu-16.04",
|
|
659
659
|
# :provisioner => {
|
|
660
660
|
# :attributes => { :one => "two" },
|
|
661
661
|
# :run_list => ["alpha", "bravo"]
|
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
data/lib/kitchen/driver/proxy.rb
CHANGED
|
@@ -60,7 +60,7 @@ module Kitchen
|
|
|
60
60
|
# @param state [Hash] the state hash
|
|
61
61
|
# @api private
|
|
62
62
|
def reset_instance(state)
|
|
63
|
-
if cmd = config[:reset_command]
|
|
63
|
+
if (cmd = config[:reset_command])
|
|
64
64
|
info("Resetting instance state with command: #{cmd}")
|
|
65
65
|
ssh(build_ssh_args(state), cmd)
|
|
66
66
|
end
|
|
File without changes
|
data/lib/kitchen/errors.rb
CHANGED
|
File without changes
|
|
@@ -64,7 +64,6 @@ module Kitchen
|
|
|
64
64
|
create_test_dir
|
|
65
65
|
prepare_gitignore
|
|
66
66
|
prepare_gemfile
|
|
67
|
-
add_drivers
|
|
68
67
|
display_bundle_message
|
|
69
68
|
end
|
|
70
69
|
|
|
@@ -80,7 +79,7 @@ module Kitchen
|
|
|
80
79
|
run_list = cookbook_name ? "recipe[#{cookbook_name}::default]" : nil
|
|
81
80
|
driver_plugin = Array(options[:driver]).first || "dummy"
|
|
82
81
|
|
|
83
|
-
template("kitchen.yml.erb", "
|
|
82
|
+
template("kitchen.yml.erb", "kitchen.yml",
|
|
84
83
|
driver_plugin: driver_plugin.sub(/^kitchen-/, ""),
|
|
85
84
|
provisioner: options[:provisioner],
|
|
86
85
|
run_list: Array(run_list)
|
|
@@ -222,40 +221,6 @@ module Kitchen
|
|
|
222
221
|
end
|
|
223
222
|
end
|
|
224
223
|
|
|
225
|
-
# Appends driver gems to a Gemfile or installs them.
|
|
226
|
-
#
|
|
227
|
-
# @api private
|
|
228
|
-
def add_drivers
|
|
229
|
-
return if options[:driver].nil? || options[:driver].empty?
|
|
230
|
-
|
|
231
|
-
Array(options[:driver]).each do |driver_gem|
|
|
232
|
-
if File.exist?(File.join(destination_root, "Gemfile")) || options[:create_gemfile]
|
|
233
|
-
add_driver_to_gemfile(driver_gem)
|
|
234
|
-
else
|
|
235
|
-
install_gem(driver_gem)
|
|
236
|
-
end
|
|
237
|
-
end
|
|
238
|
-
end
|
|
239
|
-
|
|
240
|
-
# Appends a driver gem to a Gemfile.
|
|
241
|
-
#
|
|
242
|
-
# @api private
|
|
243
|
-
def add_driver_to_gemfile(driver_gem)
|
|
244
|
-
if not_in_file?("Gemfile", /gem ('|")#{driver_gem}('|")/)
|
|
245
|
-
append_to_file("Gemfile", %{gem "#{driver_gem}"\n})
|
|
246
|
-
@display_bundle_msg = true
|
|
247
|
-
end
|
|
248
|
-
end
|
|
249
|
-
|
|
250
|
-
# Installs a driver gem.
|
|
251
|
-
#
|
|
252
|
-
# @api private
|
|
253
|
-
def install_gem(driver_gem)
|
|
254
|
-
unbundlerize { Gem::GemRunner.new.run(["install", driver_gem]) }
|
|
255
|
-
rescue Gem::SystemExitException => e
|
|
256
|
-
raise unless e.exit_code == 0
|
|
257
|
-
end
|
|
258
|
-
|
|
259
224
|
# Displays a bundle warning message to the user.
|
|
260
225
|
#
|
|
261
226
|
# @api private
|
data/lib/kitchen/instance.rb
CHANGED
|
File without changes
|
data/lib/kitchen/lazy_hash.rb
CHANGED
data/lib/kitchen/loader/yaml.rb
CHANGED
|
@@ -34,9 +34,9 @@ module Kitchen
|
|
|
34
34
|
#
|
|
35
35
|
# @param options [Hash] configuration for a new loader
|
|
36
36
|
# @option options [String] :project_config path to the Kitchen
|
|
37
|
-
# config YAML file (default:
|
|
37
|
+
# config YAML file (default: `./kitchen.yml`)
|
|
38
38
|
# @option options [String] :local_config path to the Kitchen local
|
|
39
|
-
# config YAML file (default:
|
|
39
|
+
# config YAML file (default: `./kitchen.local.yml`)
|
|
40
40
|
# @option options [String] :global_config path to the Kitchen global
|
|
41
41
|
# config YAML file (default: `$HOME/.kitchen/config.yml`)
|
|
42
42
|
# @option options [String] :process_erb whether or not to process YAML
|
|
@@ -186,21 +186,46 @@ module Kitchen
|
|
|
186
186
|
end
|
|
187
187
|
|
|
188
188
|
# Determines the default absolute path to the Kitchen config YAML file,
|
|
189
|
-
# based on current working directory.
|
|
189
|
+
# based on current working directory. We prefer `kitchen.yml` to the
|
|
190
|
+
# older `.kitchen.yml`.
|
|
190
191
|
#
|
|
191
192
|
# @return [String] an absolute path to a Kitchen config YAML file
|
|
192
193
|
# @api private
|
|
193
194
|
def default_config_file
|
|
195
|
+
if File.exist?(kitchen_yml) && File.exist?(dot_kitchen_yml)
|
|
196
|
+
raise UserError, "Both #{kitchen_yml} and #{dot_kitchen_yml} found. Please use the un-dotted variant: #{kitchen_yml}."
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
File.exist?(kitchen_yml) ? kitchen_yml : dot_kitchen_yml
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
# The absolute path to an un-hidden Kitchen config YAML file.
|
|
203
|
+
def kitchen_yml
|
|
204
|
+
File.join(Dir.pwd, "kitchen.yml")
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
# The absolute path to an hidden Kitchen config YAML file.
|
|
208
|
+
def dot_kitchen_yml
|
|
194
209
|
File.join(Dir.pwd, ".kitchen.yml")
|
|
195
210
|
end
|
|
196
211
|
|
|
197
212
|
# Determines the default absolute path to the Kitchen local YAML file,
|
|
198
213
|
# based on the base Kitchen config YAML file.
|
|
199
|
-
|
|
214
|
+
|
|
200
215
|
# @return [String] an absolute path to a Kitchen local YAML file
|
|
216
|
+
# @raise [UserError] if both dotted and undotted versions of the default
|
|
217
|
+
# local YAML file exist, e.g. both kitchen.local.yml and .kitchen.local.yml
|
|
201
218
|
# @api private
|
|
202
219
|
def default_local_config_file
|
|
203
|
-
config_file.sub(/(#{File.extname(config_file)})$/, '.local\1')
|
|
220
|
+
config_dir, default_local_config = File.split(config_file.sub(/(#{File.extname(config_file)})$/, '.local\1'))
|
|
221
|
+
|
|
222
|
+
undot_config = default_local_config.sub(/^\./, "")
|
|
223
|
+
dot_config = ".#{undot_config}"
|
|
224
|
+
if File.exist?(File.join(config_dir, undot_config)) && File.exist?(File.join(config_dir, dot_config))
|
|
225
|
+
raise UserError, "Both #{undot_config} and #{dot_config} found in #{config_dir}. Please use #{default_local_config} which matches your #{config_file}."
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
File.join(config_dir, default_local_config)
|
|
204
229
|
end
|
|
205
230
|
|
|
206
231
|
# Determines the default absolute path to the Kitchen global YAML file,
|
|
@@ -322,7 +347,7 @@ module Kitchen
|
|
|
322
347
|
def parse_yaml_string(string, file_name)
|
|
323
348
|
return {} if string.nil? || string.empty?
|
|
324
349
|
|
|
325
|
-
result = ::YAML.safe_load(string, [Symbol]) || {}
|
|
350
|
+
result = ::YAML.safe_load(string, [Symbol], [], true) || {}
|
|
326
351
|
unless result.is_a?(Hash)
|
|
327
352
|
raise UserError, "Error parsing #{file_name} as YAML " \
|
|
328
353
|
"(Result of parse was not a Hash, but was a #{result.class}).\n" \
|
data/lib/kitchen/logger.rb
CHANGED
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
|
|
File without changes
|
|
@@ -85,27 +85,31 @@ module Kitchen
|
|
|
85
85
|
# @api private
|
|
86
86
|
attr_reader :always_update
|
|
87
87
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
# @param logger [Kitchen::Logger] the logger to use
|
|
91
|
-
# @raise [UserError] if the library couldn't be loaded
|
|
92
|
-
# @api private
|
|
93
|
-
def self.load_berkshelf!(logger)
|
|
94
|
-
first_load = require "berkshelf"
|
|
88
|
+
class << self
|
|
89
|
+
private
|
|
95
90
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
91
|
+
# Load the Berkshelf-specific libary code.
|
|
92
|
+
#
|
|
93
|
+
# @param logger [Kitchen::Logger] the logger to use
|
|
94
|
+
# @raise [UserError] if the library couldn't be loaded
|
|
95
|
+
# @api private
|
|
96
|
+
def load_berkshelf!(logger)
|
|
97
|
+
first_load = require "berkshelf"
|
|
98
|
+
|
|
99
|
+
version = ::Berkshelf::VERSION
|
|
100
|
+
if first_load
|
|
101
|
+
logger.debug("Berkshelf #{version} library loaded")
|
|
102
|
+
else
|
|
103
|
+
logger.debug("Berkshelf #{version} previously loaded")
|
|
104
|
+
end
|
|
105
|
+
rescue LoadError => e
|
|
106
|
+
logger.fatal("The `berkshelf' gem is missing and must be installed" \
|
|
107
|
+
" or cannot be properly activated. Run" \
|
|
108
|
+
" `gem install berkshelf` or add the following to your" \
|
|
109
|
+
" Gemfile if you are using Bundler: `gem 'berkshelf'`.")
|
|
110
|
+
raise UserError,
|
|
111
|
+
"Could not load or activate Berkshelf (#{e.message})"
|
|
101
112
|
end
|
|
102
|
-
rescue LoadError => e
|
|
103
|
-
logger.fatal("The `berkshelf' gem is missing and must be installed" \
|
|
104
|
-
" or cannot be properly activated. Run" \
|
|
105
|
-
" `gem install berkshelf` or add the following to your" \
|
|
106
|
-
" Gemfile if you are using Bundler: `gem 'berkshelf'`.")
|
|
107
|
-
raise UserError,
|
|
108
|
-
"Could not load or activate Berkshelf (#{e.message})"
|
|
109
113
|
end
|
|
110
114
|
end
|
|
111
115
|
end
|
|
File without changes
|
|
@@ -78,29 +78,33 @@ module Kitchen
|
|
|
78
78
|
# @api private
|
|
79
79
|
attr_reader :logger
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
# @param logger [Kitchen::Logger] the logger to use
|
|
84
|
-
# @raise [UserError] if the library couldn't be loaded
|
|
85
|
-
# @api private
|
|
86
|
-
def self.load_librarian!(logger)
|
|
87
|
-
first_load = require "librarian/chef/environment"
|
|
88
|
-
require "librarian/action/resolve"
|
|
89
|
-
require "librarian/action/install"
|
|
81
|
+
class << self
|
|
82
|
+
private
|
|
90
83
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
84
|
+
# Load the Librarian-specific libary code.
|
|
85
|
+
#
|
|
86
|
+
# @param logger [Kitchen::Logger] the logger to use
|
|
87
|
+
# @raise [UserError] if the library couldn't be loaded
|
|
88
|
+
# @api private
|
|
89
|
+
def load_librarian!(logger)
|
|
90
|
+
first_load = require "librarian/chef/environment"
|
|
91
|
+
require "librarian/action/resolve"
|
|
92
|
+
require "librarian/action/install"
|
|
93
|
+
|
|
94
|
+
version = ::Librarian::Chef::VERSION
|
|
95
|
+
if first_load
|
|
96
|
+
logger.debug("Librarian-Chef #{version} library loaded")
|
|
97
|
+
else
|
|
98
|
+
logger.debug("Librarian-Chef #{version} previously loaded")
|
|
99
|
+
end
|
|
100
|
+
rescue LoadError => e
|
|
101
|
+
logger.fatal("The `librarian-chef' gem is missing and must be installed" \
|
|
102
|
+
" or cannot be properly activated. Run" \
|
|
103
|
+
" `gem install librarian-chef` or add the following to your" \
|
|
104
|
+
" Gemfile if you are using Bundler: `gem 'librarian-chef'`.")
|
|
105
|
+
raise UserError,
|
|
106
|
+
"Could not load or activate Librarian-Chef (#{e.message})"
|
|
96
107
|
end
|
|
97
|
-
rescue LoadError => e
|
|
98
|
-
logger.fatal("The `librarian-chef' gem is missing and must be installed" \
|
|
99
|
-
" or cannot be properly activated. Run" \
|
|
100
|
-
" `gem install librarian-chef` or add the following to your" \
|
|
101
|
-
" Gemfile if you are using Bundler: `gem 'librarian-chef'`.")
|
|
102
|
-
raise UserError,
|
|
103
|
-
"Could not load or activate Librarian-Chef (#{e.message})"
|
|
104
108
|
end
|
|
105
109
|
end
|
|
106
110
|
end
|