inspec 0.19.2 → 0.19.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/CHANGELOG.md +13 -2
- data/lib/inspec/metadata.rb +34 -14
- data/lib/inspec/version.rb +1 -1
- data/test/unit/metadata_test.rb +9 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
Y2RmMzdlYzM1NmRkODlmNDNiZDRjMTg4MTkxZDczOGM4ZWEyMjdmNw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NjFmODBkODVkMTI5MzljNjk1NzI4MGNjNDZkMzc0YTczODExYjYwMA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YzM5Njc4YTc2NTZjNTk0ZTNlYWVlYWU0ZTU3ZGVlNDU2OTA2NWIxZjA5ZDRi
|
10
|
+
MjVlYWZhNDViZjU4NmIzNDZkNjcwOThkMWZkZGY2NjU4YjI4MzFlMWU1ZjE0
|
11
|
+
MDY0NDZhOGRiODU4YTFmNWExMGYwYzYwZGYxMTI2Nzg0N2U3Y2M=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NGUwMDk1YWFiMmM3ZTNjOGMxY2ZmMjBmYzFmNGIyZWMwYmM4MDNiZWZkYjRm
|
14
|
+
YTIzMDkyNjg0ODk1YzllNjJmNDMxMzdhMTUyZmQxZTYwMWIwNDVlYTJmNTQ0
|
15
|
+
ZWUyNzljYjM1NzMzOWFlOWVmOTU4NWE0N2ZhN2FhNTlkODU0N2E=
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,18 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
-
## [0.19.
|
4
|
-
[Full Changelog](https://github.com/chef/inspec/compare/v0.19.
|
3
|
+
## [0.19.3](https://github.com/chef/inspec/tree/0.19.3) (2016-04-22)
|
4
|
+
[Full Changelog](https://github.com/chef/inspec/compare/v0.19.2...0.19.3)
|
5
|
+
|
6
|
+
**Fixed bugs:**
|
7
|
+
|
8
|
+
- fix legacy supports call [\#679](https://github.com/chef/inspec/pull/679) ([arlimus](https://github.com/arlimus))
|
9
|
+
|
10
|
+
**Merged pull requests:**
|
11
|
+
|
12
|
+
- v0.19.2 [\#675](https://github.com/chef/inspec/pull/675) ([arlimus](https://github.com/arlimus))
|
13
|
+
|
14
|
+
## [v0.19.2](https://github.com/chef/inspec/tree/v0.19.2) (2016-04-21)
|
15
|
+
[Full Changelog](https://github.com/chef/inspec/compare/v0.19.1...v0.19.2)
|
5
16
|
|
6
17
|
**Implemented enhancements:**
|
7
18
|
|
data/lib/inspec/metadata.rb
CHANGED
@@ -137,26 +137,46 @@ module Inspec
|
|
137
137
|
}
|
138
138
|
end
|
139
139
|
|
140
|
+
def self.finalize_supports_elem(elem, logger)
|
141
|
+
case x = elem
|
142
|
+
when Hash then x
|
143
|
+
when Array
|
144
|
+
logger.warn(
|
145
|
+
'Failed to read supports entry that is an array. Please use '\
|
146
|
+
'the `supports: {os-family: xyz}` syntax.',
|
147
|
+
)
|
148
|
+
nil
|
149
|
+
when nil then nil
|
150
|
+
else
|
151
|
+
logger ||= Logger.new(nil)
|
152
|
+
logger.warn(
|
153
|
+
"Do not use deprecated `supports: #{x}` syntax. Instead use:\n"\
|
154
|
+
"supports:\n - os-family: #{x}\n\n")
|
155
|
+
{ :'os-family' => x }
|
156
|
+
end
|
157
|
+
end
|
158
|
+
|
159
|
+
def self.finalize_supports(supports, logger)
|
160
|
+
case x = supports
|
161
|
+
when Hash then [x]
|
162
|
+
when Array then x.map { |e| finalize_supports_elem(e, logger) }.compact
|
163
|
+
when nil then []
|
164
|
+
else
|
165
|
+
logger ||= Logger.new(nil)
|
166
|
+
logger.warn(
|
167
|
+
"Do not use deprecated `supports: #{x}` syntax. Instead use:\n"\
|
168
|
+
"supports:\n - os-family: #{x}\n\n")
|
169
|
+
[{ :'os-family' => x }]
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
140
173
|
def self.finalize(metadata, profile_id, logger = nil)
|
141
174
|
return nil if metadata.nil?
|
142
175
|
param = metadata.params || {}
|
143
176
|
param['name'] = profile_id.to_s unless profile_id.to_s.empty?
|
144
177
|
param['version'] = param['version'].to_s unless param['version'].nil?
|
145
178
|
metadata.params = symbolize_keys(param)
|
146
|
-
|
147
|
-
# consolidate supports field with legacy mode
|
148
|
-
metadata.params[:supports] =
|
149
|
-
case x = metadata.params[:supports]
|
150
|
-
when Hash then [x]
|
151
|
-
when Array then x
|
152
|
-
when nil then []
|
153
|
-
else
|
154
|
-
logger ||= Logger.new(nil)
|
155
|
-
logger.warn(
|
156
|
-
"Do not use deprecated `supports: #{x}` syntax. Instead use "\
|
157
|
-
"`supports: {os-family: #{x}}`.")
|
158
|
-
[{ :'os-family' => x }]
|
159
|
-
end
|
179
|
+
metadata.params[:supports] = finalize_supports(metadata.params[:supports], logger)
|
160
180
|
|
161
181
|
metadata
|
162
182
|
end
|
data/lib/inspec/version.rb
CHANGED
data/test/unit/metadata_test.rb
CHANGED
@@ -50,14 +50,20 @@ describe 'metadata with supported operating systems' do
|
|
50
50
|
|
51
51
|
it 'supports legacy simple support style, but warns' do
|
52
52
|
# i.e. setting this to something that would fail:
|
53
|
-
logger.expect :warn, nil, [
|
54
|
-
'Do not use deprecated `supports: linux` '\
|
55
|
-
'syntax. Instead use `supports: {os-family: linux}`.']
|
53
|
+
logger.expect :warn, nil, ["Do not use deprecated `supports: linux` syntax. Instead use:\nsupports:\n - os-family: linux\n\n"]
|
56
54
|
m = supports_meta('linux')
|
57
55
|
m.supports_transport?(backend).must_equal true
|
58
56
|
logger.verify
|
59
57
|
end
|
60
58
|
|
59
|
+
it 'supports legacy simple support style, but warns' do
|
60
|
+
# i.e. setting this to something that would fail:
|
61
|
+
logger.expect :warn, nil, ["Do not use deprecated `supports: linux` syntax. Instead use:\nsupports:\n - os-family: linux\n\n"]
|
62
|
+
m = supports_meta(['linux'])
|
63
|
+
m.supports_transport?(backend).must_equal true
|
64
|
+
logger.verify
|
65
|
+
end
|
66
|
+
|
61
67
|
it 'loads a profile which supports os ubuntu' do
|
62
68
|
m = supports_meta({ 'os' => 'ubuntu' })
|
63
69
|
m.supports_transport?(backend).must_equal true
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.19.
|
4
|
+
version: 0.19.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dominik Richter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: r-train
|
@@ -609,7 +609,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
609
609
|
version: '0'
|
610
610
|
requirements: []
|
611
611
|
rubyforge_project:
|
612
|
-
rubygems_version: 2.4.
|
612
|
+
rubygems_version: 2.4.3
|
613
613
|
signing_key:
|
614
614
|
specification_version: 4
|
615
615
|
summary: Infrastructure and compliance testing.
|