jackal-cfn 0.2.20 → 0.2.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/jackal-cfn/resource/orchestration_unit.rb +32 -28
- data/lib/jackal-cfn/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: 15f415b007eb56efb5bdea8203145bf22237be04
|
|
4
|
+
data.tar.gz: 6a14b2e02d211245ebe684e462ec43ab8f9c9bd6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a79e33ac6b69adc5352da7e37e37fcf9e22be023e2ea621a60d58f4fb0a970827d88d5986cc6c548854ed73dbf2ddd3687dc9d9050bc188f0487c87dbaceed8b
|
|
7
|
+
data.tar.gz: f33b1776de428e30d3b520f8ed3cd37f5d88ed22dfceb917fd3dfb052efea99f6866eaf9ff8600cdb87185bf35f35e96c90e7d4e5572459c387efa9c9e6a8d41
|
data/CHANGELOG.md
CHANGED
|
@@ -110,36 +110,40 @@ module Jackal
|
|
|
110
110
|
end
|
|
111
111
|
if(unit[:exec])
|
|
112
112
|
result = Smash.new
|
|
113
|
-
process_manager.
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
process.
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
process.
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
warn "Command result greater than allowed size: #{stdout.size} > #{MAX_RESULT_SIZE}"
|
|
136
|
-
end
|
|
137
|
-
result[:content] = stdout.readpartial(0, MAX_RESULT_SIZE)
|
|
138
|
-
if(process.exit_code != 0)
|
|
139
|
-
stderr.rewind
|
|
140
|
-
result[:error_message] = stderr.readpartial(0, MAX_RESULT_SIZE)
|
|
113
|
+
stdout = process_manager.create_io_tmp(Carnivore.uuid, 'stdout')
|
|
114
|
+
stderr = process_manager.create_io_tmp(Carnivore.uuid, 'stderr')
|
|
115
|
+
result[:start_time] = Time.now.to_i
|
|
116
|
+
[unit[:exec]].flatten.each do |exec_command|
|
|
117
|
+
process_manager.process(unit.hash, exec_command) do |process|
|
|
118
|
+
process.io.stdout = stdout
|
|
119
|
+
process.io.stderr = stderr
|
|
120
|
+
process.cwd = working_directory
|
|
121
|
+
if(unit[:env])
|
|
122
|
+
process.environment.replace(unit[:env])
|
|
123
|
+
end
|
|
124
|
+
process.leader = true
|
|
125
|
+
process.start
|
|
126
|
+
begin
|
|
127
|
+
process.poll_for_exit(config.fetch(:max_execution_time, 60))
|
|
128
|
+
result[:exit_code] = process.exit_code
|
|
129
|
+
break if result[:exit_code] != 0
|
|
130
|
+
rescue ChildProcess::TimeoutError
|
|
131
|
+
process.stop
|
|
132
|
+
result[:timed_out] = true
|
|
133
|
+
result[:exit_code] = process.exit_code
|
|
134
|
+
end
|
|
141
135
|
end
|
|
142
136
|
end
|
|
137
|
+
result[:stop_time] = Time.now.to_i
|
|
138
|
+
stdout.rewind
|
|
139
|
+
if(stdout.size > MAX_RESULT_SIZE)
|
|
140
|
+
warn "Command result greater than allowed size: #{stdout.size} > #{MAX_RESULT_SIZE}"
|
|
141
|
+
end
|
|
142
|
+
result[:content] = stdout.readpartial(0, MAX_RESULT_SIZE)
|
|
143
|
+
if(result[:exit_code] != 0)
|
|
144
|
+
stderr.rewind
|
|
145
|
+
result[:error_message] = stderr.readpartial(0, MAX_RESULT_SIZE)
|
|
146
|
+
end
|
|
143
147
|
if(result[:exit_code] == 0)
|
|
144
148
|
response['Data']['OrchestrationUnitResult'] = result[:content]
|
|
145
149
|
begin
|
data/lib/jackal-cfn/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: jackal-cfn
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.22
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Chris Roberts
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-
|
|
11
|
+
date: 2016-03-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: jackal
|