kitchen-dokken 2.0.13 → 2.0.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d1c56e557b085b85fef2586adcbe0b71e4603a3c
4
- data.tar.gz: 57e1bd8d2b63f6f319a6d80b674b60224ea11b34
3
+ metadata.gz: 5befb25e9af14115657f2ad87b88c7c384ebf53b
4
+ data.tar.gz: 255c175defd349e3e9ee07fa3f84cdd6527486c0
5
5
  SHA512:
6
- metadata.gz: a4660f946cb63fbbca01a65a7a39fca56a392aec5ded63c53907a7ae12253d735c7fd574708e6dcccd8f92fb1d4b5da14b922faf9bb895cd2addb90115648a8b
7
- data.tar.gz: 3eb1363e174132e1f9606366c1c85d537b5dd9a728c777e8ee722157b4f509f294060b48e1d7c2c4fe3e4bd6b14db3cd021f293c46c30c1102a706a770ce2965
6
+ metadata.gz: 29606237be93c692d0f3d625f35318b7aed088dd716cbab51be89fd56e03e3e617fd42671bcc90dba2d4f58badd41937d00e343fbd4a93d25b3e2fe235ee6871
7
+ data.tar.gz: c532bea9da3fa79e6e35d7fc6fe3f92e357b2b157d08f12afc56de457f747d9a8b41601620040d8b9667fb53175c7815290e1200aad66f977cc6954c26fd6855
@@ -19,6 +19,6 @@
19
19
  module Kitchen
20
20
  module Driver
21
21
  # Version string for Dokken Kitchen driver
22
- DOKKEN_VERSION = '2.0.13'.freeze
22
+ DOKKEN_VERSION = '2.0.14'.freeze
23
23
  end
24
24
  end
@@ -31,6 +31,10 @@ module Kitchen
31
31
  plugin_version Kitchen::VERSION
32
32
 
33
33
  default_config :root_path, '/opt/kitchen'
34
+ default_config :chef_binary, '/opt/chef/embedded/bin/chef-client'
35
+ default_config :chef_options, ' -z'
36
+ default_config :chef_log_level, 'warn'
37
+ default_config :chef_output_format, 'doc'
34
38
 
35
39
  # (see Base#call)
36
40
  def call(state)
@@ -44,16 +48,39 @@ module Kitchen
44
48
  # cleanup_sandbox
45
49
  end
46
50
 
51
+ def validate_config
52
+ # check if we have an space for the user provided options
53
+ # or add it if not to avoid issues
54
+ unless config[:chef_options].start_with? ' '
55
+ config[:chef_options].prepend(' ')
56
+ end
57
+
58
+ # strip spaces from all other options
59
+ config[:chef_binary] = config[:chef_binary].strip
60
+ config[:chef_log_level] = config[:chef_log_level].strip
61
+ config[:chef_output_format] = config[:chef_output_format].strip
62
+
63
+ # if the user wants to be funny and pass empty strings
64
+ # just use the defaults
65
+ if config[:chef_log_level].empty?
66
+ config[:chef_log_level] = 'warn'
67
+ end
68
+ if config[:chef_output_format].empty?
69
+ config[:chef_output_format] = 'doc'
70
+ end
71
+ end
72
+
47
73
  private
48
74
 
49
75
  # patching Kitchen::Provisioner::ChefZero#run_command
50
76
  def run_command
51
- cmd = '/opt/chef/bin/chef-client'
52
- cmd << ' -z'
77
+ validate_config
78
+ cmd = config[:chef_binary]
79
+ cmd << config[:chef_options].to_s
80
+ cmd << " -l #{config[:chef_log_level]}"
81
+ cmd << " -F #{config[:chef_output_format]}"
53
82
  cmd << ' -c /opt/kitchen/client.rb'
54
83
  cmd << ' -j /opt/kitchen/dna.json'
55
- cmd << ' -l warn'
56
- cmd << ' -F doc'
57
84
  end
58
85
 
59
86
  def runner_container_name
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-dokken
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.13
4
+ version: 2.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean OMeara
@@ -45,7 +45,6 @@ executables: []
45
45
  extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
- - CHANGELOG.md
49
48
  - LICENSE
50
49
  - lib/kitchen/driver/dokken.rb
51
50
  - lib/kitchen/driver/dokken_version.rb
data/CHANGELOG.md DELETED
@@ -1,3 +0,0 @@
1
- ## 0.1.0 / Unreleased
2
-
3
- * Initial release