right_scraper 5.2.8 → 5.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/right_scraper/scanners/cookbook_metadata.rb +17 -11
- data/lib/right_scraper/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fbe07e9cf37a9a0238de7b1a24a8441df3217d69
|
4
|
+
data.tar.gz: 9bd77beb7c966c4b131109633e4684c06903ba9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 462d861098695ee9f831874d613d498d1bae887d4449fd70390381cfdefcc4af77440d4372017dabcf05a0c5443215144fea4b3ec5c1fbdc72fe3a7210146425
|
7
|
+
data.tar.gz: 2a3a59bc1391c2562b804eed520a8314372e400b92e5dbede329fea0a5d85dae4a5ebbf31f0db391f653cef69f247137a07b9446e1a5992827ecfe5c4fc9783f
|
@@ -26,6 +26,7 @@ require 'right_scraper/scanners'
|
|
26
26
|
|
27
27
|
require 'fileutils'
|
28
28
|
require 'json'
|
29
|
+
require 'right_git'
|
29
30
|
require 'right_popen'
|
30
31
|
require 'right_popen/safe_output_buffer'
|
31
32
|
require 'tmpdir'
|
@@ -37,11 +38,13 @@ module RightScraper::Scanners
|
|
37
38
|
JSON_METADATA = 'metadata.json'
|
38
39
|
RUBY_METADATA = 'metadata.rb'
|
39
40
|
|
40
|
-
UNDEFINED_COOKBOOK_NAME
|
41
|
+
UNDEFINED_COOKBOOK_NAME = 'undefined'
|
41
42
|
KNIFE_METADATA_SCRIPT_NAME = 'knife_metadata.rb'
|
43
|
+
KNIFE_METADATA_TIMEOUT = 60 # 1m
|
42
44
|
|
43
45
|
JAILED_FILE_SIZE_CONSTRAINT = 128 * 1024 # 128 KB
|
44
|
-
FREED_FILE_SIZE_CONSTRAINT
|
46
|
+
FREED_FILE_SIZE_CONSTRAINT = 64 * 1024 # 64 KB
|
47
|
+
|
45
48
|
|
46
49
|
attr_reader :freed_dir
|
47
50
|
|
@@ -244,16 +247,19 @@ module RightScraper::Scanners
|
|
244
247
|
# imposed on the current process by a container (timeout, memory, etc.)
|
245
248
|
shell = ::RightGit::Shell::Default
|
246
249
|
output = StringIO.new
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
250
|
+
begin
|
251
|
+
shell.execute(
|
252
|
+
"#{ruby} #{dst_knife_script_path.inspect} #{jailed_cookbook_dir.inspect} 2>&1",
|
253
|
+
directory: dst_knife_script_dir,
|
254
|
+
outstream: output,
|
255
|
+
raise_on_failure: true,
|
256
|
+
set_env_vars: { LC_ALL: 'en_US.UTF-8' }, # character encoding for emitted JSON
|
257
|
+
clear_env_vars: %w{BUNDLE_BIN_PATH BUNDLE_GEMFILE},
|
258
|
+
timeout: KNIFE_METADATA_TIMEOUT)
|
259
|
+
output = output.string
|
260
|
+
rescue ::RightGit::Shell::ShellError => e
|
255
261
|
output = output.string
|
256
|
-
raise MetadataError, "Failed to run chef knife: #{output[0, 1024]}"
|
262
|
+
raise MetadataError, "Failed to run chef knife: #{e.message}\n#{output[0, 1024]}"
|
257
263
|
end
|
258
264
|
|
259
265
|
# free files from jail.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: right_scraper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Raphael Simon
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-
|
13
|
+
date: 2016-04-01 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: right_aws
|