jackal-cfn 0.2.24 → 0.2.26
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 +4 -0
- data/lib/jackal-cfn/resource/orchestration_unit.rb +12 -2
- 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: 4e0eb97177871e4d5e59799e6dcd6348e3f37f82
|
4
|
+
data.tar.gz: b965abfa8ca1b3a6bfda081d8db644d8591699d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1dddef4c1cca5592238e40fcc0a31bbcf95d1ff6a43ad1da9542306017c91983bc6f21d82666f83bc421bdf64bcf5f0f790cda7d09446501575f42e03ec6cede
|
7
|
+
data.tar.gz: 02f44b55eb33008fc49d28166ccc083db25b94858dc9981c3ebaba96c12205095d6d3eb0880aefb658e3377ef507e0700f18f381b1552644e03a6e9aeee7b6e5
|
data/CHANGELOG.md
CHANGED
@@ -106,19 +106,23 @@ module Jackal
|
|
106
106
|
# @return [Hash] CFN response
|
107
107
|
def run_unit(unit, working_directory, response)
|
108
108
|
if(unit[:exec_zip])
|
109
|
+
debug "Unit provided is compressed zip: #{unit[:exec_zip]}"
|
109
110
|
fetch_and_unpack_exec(unit, working_directory)
|
110
111
|
end
|
111
112
|
if(unit[:exec])
|
113
|
+
debug "Unit to execute: #{unit[:exec]}"
|
112
114
|
result = Smash.new
|
113
115
|
stdout = process_manager.create_io_tmp(Carnivore.uuid, 'stdout')
|
114
116
|
stderr = process_manager.create_io_tmp(Carnivore.uuid, 'stderr')
|
115
117
|
result[:start_time] = Time.now.to_i
|
116
118
|
[unit[:exec]].flatten.each do |exec_command|
|
119
|
+
debug "Command to execute: #{exec_command}"
|
117
120
|
process_manager.process(unit.hash, exec_command) do |process|
|
118
121
|
process.io.stdout = stdout
|
119
122
|
process.io.stderr = stderr
|
120
123
|
process.cwd = working_directory
|
121
124
|
if(unit[:env])
|
125
|
+
debug "Custom environment defined: #{unit[:env]}"
|
122
126
|
process.environment.replace(unit[:env])
|
123
127
|
end
|
124
128
|
process.leader = true
|
@@ -127,6 +131,7 @@ module Jackal
|
|
127
131
|
process.poll_for_exit(config.fetch(:max_execution_time, 60))
|
128
132
|
result[:exit_code] = process.exit_code
|
129
133
|
break if result[:exit_code] != 0
|
134
|
+
debug "Execution of command successful - #{exec_command}"
|
130
135
|
rescue ChildProcess::TimeoutError
|
131
136
|
process.stop
|
132
137
|
result[:timed_out] = true
|
@@ -139,10 +144,15 @@ module Jackal
|
|
139
144
|
if(stdout.size > MAX_RESULT_SIZE)
|
140
145
|
warn "Command result greater than allowed size: #{stdout.size} > #{MAX_RESULT_SIZE}"
|
141
146
|
end
|
142
|
-
result[:content] = stdout.readpartial(
|
147
|
+
result[:content] = stdout.readpartial(MAX_RESULT_SIZE)
|
143
148
|
if(result[:exit_code] != 0)
|
149
|
+
debug "Execution of unit failed - #{unit}"
|
144
150
|
stderr.rewind
|
145
|
-
result[:error_message] = stderr.readpartial(
|
151
|
+
result[:error_message] = stderr.readpartial(MAX_RESULT_SIZE)
|
152
|
+
stderr.rewind
|
153
|
+
stdout.rewind
|
154
|
+
debug "Failed unit STDOUT: #{stdout.read}"
|
155
|
+
debug "Failed unit STDERR: #{stderr.read}"
|
146
156
|
end
|
147
157
|
if(result[:exit_code] == 0)
|
148
158
|
response['Data']['OrchestrationUnitResult'] = result[:content]
|
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.26
|
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-03-
|
11
|
+
date: 2016-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jackal
|