jackal-cfn 0.2.24 → 0.2.26

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
  SHA1:
3
- metadata.gz: 169f3e4aaad15c0e3d62ac9bfc2d41df687cb25b
4
- data.tar.gz: a2fd2b4845e5e24d1c219357f7dfafb02c407687
3
+ metadata.gz: 4e0eb97177871e4d5e59799e6dcd6348e3f37f82
4
+ data.tar.gz: b965abfa8ca1b3a6bfda081d8db644d8591699d4
5
5
  SHA512:
6
- metadata.gz: 7c82910d725fd82db1f7d8beaed2dcaa7edcdf0d739f2b4b63782397d16123ea327c8a9b16d939e5e7a0fef6b5b584fd190be2bf71a9de533930715ce9112b36
7
- data.tar.gz: 97ee96231e828993227a40bbbf66d072b3d158a25d690efb43e0cc4683aa94cd54275dc74d0721c6d1c3bd1c398fe34f435891577ee2cee2f17be673b5f4948d
6
+ metadata.gz: 1dddef4c1cca5592238e40fcc0a31bbcf95d1ff6a43ad1da9542306017c91983bc6f21d82666f83bc421bdf64bcf5f0f790cda7d09446501575f42e03ec6cede
7
+ data.tar.gz: 02f44b55eb33008fc49d28166ccc083db25b94858dc9981c3ebaba96c12205095d6d3eb0880aefb658e3377ef507e0700f18f381b1552644e03a6e9aeee7b6e5
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # v0.2.26
2
+ * [fix] Update readpartial usage in OrchestrationUnit
3
+ * [enhancement] Add debug output to OrchestrationUnit execution
4
+
1
5
  # v0.2.24
2
6
  * [fix] Account for pre-unpacked body in payload
3
7
 
@@ -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(0, MAX_RESULT_SIZE)
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(0, MAX_RESULT_SIZE)
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]
@@ -1,6 +1,6 @@
1
1
  module Jackal
2
2
  module Cfn
3
3
  # Current version
4
- VERSION = Gem::Version.new('0.2.24')
4
+ VERSION = Gem::Version.new('0.2.26')
5
5
  end
6
6
  end
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.24
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-04 00:00:00.000000000 Z
11
+ date: 2016-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jackal