simp-beaker-helpers 1.10.3 → 1.10.4

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
  SHA256:
3
- metadata.gz: 2abf8d079a5c6cfaae432269cdec1cc0a4fa2fd826ead96a7e85f4830e73c931
4
- data.tar.gz: 310f9395e48e7a26163d0a6dd11d885fef90a31d5da496180e0c62846e6f5422
3
+ metadata.gz: 48ce171f013dbe8a52759ba1916ae8d0a938725fbb7e0a99ec665d7e4f0025e0
4
+ data.tar.gz: 9e641d1cec4789762b4edb28e16491a0775bb0e035e83f3e1df220615579c791
5
5
  SHA512:
6
- metadata.gz: 23b276d8068e784f7dcf6c4869e33fc50f5775fe76ef3a68f749356607d18462f7018d06229bf17420b30a2fb78dd0e77adaf78d1c5754c661ea6c8e6359cc4d
7
- data.tar.gz: 67a42bbc95c7e1ea60730ed0031651a502e3bac1665c070d8de1c7fecddc9268a01df0b9aa480cacada17f21933f00ec446ef4a107ef9c7e0b68a9b7642433a3
6
+ metadata.gz: a886b52d44503956347df34dcb439692d03e0bc83f7f4840569db331b8419cdf9bca07bfa9b993e1c9d0713e47714aaeb51e42b9766eae9a3548beffdefb809d
7
+ data.tar.gz: 4a8a263a155948001c12f8f5d1d8fe8b15c8bca2a36f57d6009a39ec48a3466058732482daf7a70cb0a6510cb97ab3a97bc643b2cf07e722ffa73138e28d6441
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ### 1.10.4 / 2018-04-25
2
+ * Fix Inspec report failures
3
+ * Fix SSG build failures
4
+ * Allow the SSG remediation acceptance test to fail
5
+
1
6
  ### 1.10.3 / 2018-03-23
2
7
  * Avoid warnings when using `puppet config print`
3
8
 
@@ -117,11 +117,15 @@ module Simp::BeakerHelpers
117
117
  end
118
118
  end
119
119
 
120
+ def process_inspec_results
121
+ self.class.process_inspec_results(@results)
122
+ end
123
+
120
124
  # Process the results of an InSpec run
121
125
  #
122
126
  # @return [Hash] A Hash of statistics and a formatted report
123
127
  #
124
- def process_inspec_results
128
+ def self.process_inspec_results(results)
125
129
  require 'highline'
126
130
 
127
131
  HighLine.colorize_strings
@@ -133,7 +137,21 @@ module Simp::BeakerHelpers
133
137
  :report => []
134
138
  }
135
139
 
136
- profiles = @results['profiles']
140
+ if results.is_a?(String)
141
+ if File.readable?(results)
142
+ profiles = JSON.load(File.read(results))['profiles']
143
+ else
144
+ fail("Error: Could not read results file at #{results}")
145
+ end
146
+ elsif results.is_a?(Hash)
147
+ profiles = results['profiles']
148
+ else
149
+ fail("Error: first argument must be a String path to a file or a Hash")
150
+ end
151
+
152
+ if !profiles || profiles.empty?
153
+ fail("Error: Could not find 'profiles' in the passed results")
154
+ end
137
155
 
138
156
  profiles.each do |profile|
139
157
  stats[:report] << "Name: #{profile['name']}"
@@ -156,7 +174,7 @@ module Simp::BeakerHelpers
156
174
  stats[:report] << title_chunks.join("\n")
157
175
  end
158
176
 
159
- if control['results']
177
+ if control['results'] && !control['results'].empty?
160
178
  status = control['results'].first['status']
161
179
  else
162
180
  status = 'skipped'
@@ -9,10 +9,11 @@ module Simp::BeakerHelpers
9
9
  end
10
10
 
11
11
  EL_PACKAGES = [
12
- 'git',
12
+ 'PyYAML',
13
13
  'cmake',
14
- 'openscap-utils',
14
+ 'git',
15
15
  'openscap-python',
16
+ 'openscap-utils',
16
17
  'python-lxml'
17
18
  ]
18
19
 
@@ -1,5 +1,5 @@
1
1
  module Simp; end
2
2
 
3
3
  module Simp::BeakerHelpers
4
- VERSION = '1.10.3'
4
+ VERSION = '1.10.4'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simp-beaker-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.3
4
+ version: 1.10.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Tessmer
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-03-23 00:00:00.000000000 Z
12
+ date: 2018-04-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: beaker