kitchen-inspec 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kitchen/verifier/inspec.rb +28 -3
- data/lib/kitchen/verifier/inspec_version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd8f48692455036fcb4a096239db49ea77cc35a40dde906080951d4df283775d
|
4
|
+
data.tar.gz: 3876f0417b27d9c7a34e44a9127937b404af9249b25b530d0ff94a0abf85ee4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8d485c2c565ad7c5867e11f8b749cc924d2319d0e9f44e767d8a230805c1b9064fa6ac3a9c245218927f03f5115a361c0bfa70649725374056be33f558befa2
|
7
|
+
data.tar.gz: 1b3c751144281043f25495e2c38d43a31d189eafecfb84a6b0ea1f7ffc9abc3b70c54ca9d90af6cb5d900157daa25ee4e62057340d7960ae21b82f978a921e57
|
@@ -69,9 +69,8 @@ module Kitchen
|
|
69
69
|
opts = runner_options(instance.transport, state, instance.platform.name, instance.suite.name)
|
70
70
|
logger.debug "Options #{opts.inspect}"
|
71
71
|
|
72
|
-
# add
|
73
|
-
opts
|
74
|
-
opts[:attributes] = Hashie.stringify_keys config[:attributes] unless config[:attributes].nil?
|
72
|
+
# add inputs
|
73
|
+
setup_inputs(opts, config)
|
75
74
|
|
76
75
|
# setup logger
|
77
76
|
::Inspec::Log.init(STDERR)
|
@@ -100,6 +99,32 @@ module Kitchen
|
|
100
99
|
|
101
100
|
private
|
102
101
|
|
102
|
+
def setup_inputs(opts, config)
|
103
|
+
inspec_version = Gem::Version.new(::Inspec::VERSION)
|
104
|
+
|
105
|
+
# Handle input files
|
106
|
+
if config[:attrs]
|
107
|
+
logger.warn("kitchen-inspec: please use 'input-files' instead of 'attrs'")
|
108
|
+
config[:input_files] = config[:attrs]
|
109
|
+
end
|
110
|
+
if config[:input_files]
|
111
|
+
# Note that inspec expects the singular inflection, input_file
|
112
|
+
files_key = inspec_version >= Gem::Version.new("3.10") ? :input_file : :attrs
|
113
|
+
opts[files_key] = config[:input_files]
|
114
|
+
end
|
115
|
+
|
116
|
+
# Handle YAML => Hash inputs
|
117
|
+
if config[:attributes]
|
118
|
+
logger.warn("kitchen-inspec: please use 'inputs' instead of 'attributes'")
|
119
|
+
config[:inputs] = config[:attributes]
|
120
|
+
end
|
121
|
+
if config[:inputs]
|
122
|
+
# Version here is dependent on https://github.com/inspec/inspec/issues/3856
|
123
|
+
inputs_key = inspec_version >= Gem::Version.new("4.10") ? :inputs : :attributes
|
124
|
+
opts[inputs_key] = Hashie.stringify_keys config[:inputs]
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
103
128
|
# (see Base#load_needed_dependencies!)
|
104
129
|
def load_needed_dependencies!
|
105
130
|
require "inspec"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kitchen-inspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chef Software, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: inspec
|
@@ -93,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
93
93
|
- !ruby/object:Gem::Version
|
94
94
|
version: '0'
|
95
95
|
requirements: []
|
96
|
-
rubygems_version: 3.0.
|
96
|
+
rubygems_version: 3.0.3
|
97
97
|
signing_key:
|
98
98
|
specification_version: 4
|
99
99
|
summary: A Test Kitchen Verifier for InSpec
|