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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bda5713d227f3483f95292f4c1d5637d2108e487
4
- data.tar.gz: 64a6507a873182488b9a749b31158cb893441fd1
3
+ metadata.gz: 15f415b007eb56efb5bdea8203145bf22237be04
4
+ data.tar.gz: 6a14b2e02d211245ebe684e462ec43ab8f9c9bd6
5
5
  SHA512:
6
- metadata.gz: 66d968cd6e691ec841d2cbdd45bbfc9631db91250ef1b26e93d6f280f58b01c63adbdbd3899762b8b3e11a8998c2b9aab0b2bfd2cf489b103be5194ebb2c4165
7
- data.tar.gz: f3695b27166715d0cb32da79f4c13e1ae1b5ee7c474c211c123bb791aed6d1f39625fb45f1187fbd9c1906ac6b9062937575f5b5aec157e4dad07a602cfaf9ba
6
+ metadata.gz: a79e33ac6b69adc5352da7e37e37fcf9e22be023e2ea621a60d58f4fb0a970827d88d5986cc6c548854ed73dbf2ddd3687dc9d9050bc188f0487c87dbaceed8b
7
+ data.tar.gz: f33b1776de428e30d3b520f8ed3cd37f5d88ed22dfceb917fd3dfb052efea99f6866eaf9ff8600cdb87185bf35f35e96c90e7d4e5572459c387efa9c9e6a8d41
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ # v0.2.22
2
+ * [enhancement] Allow OrchestrationUnit Exec property to contain list of commands
3
+
1
4
  # v0.2.20
2
5
  * [enhancement] Allow raw result removal from OrchestrationUnit resource
3
6
 
@@ -110,36 +110,40 @@ module Jackal
110
110
  end
111
111
  if(unit[:exec])
112
112
  result = Smash.new
113
- process_manager.process(unit.hash, unit[:exec]) do |process|
114
- stdout = process_manager.create_io_tmp(Carnivore.uuid, 'stdout')
115
- stderr = process_manager.create_io_tmp(Carnivore.uuid, 'stderr')
116
- process.io.stdout = stdout
117
- process.io.stderr = stderr
118
- process.cwd = working_directory
119
- if(unit[:env])
120
- process.environment.replace(unit[:env])
121
- end
122
- process.leader = true
123
- result[:start_time] = Time.now.to_i
124
- process.start
125
- begin
126
- process.poll_for_exit(config.fetch(:max_execution_time, 60))
127
- rescue ChildProcess::TimeoutError
128
- process.stop
129
- result[:timed_out] = true
130
- end
131
- result[:stop_time] = Time.now.to_i
132
- result[:exit_code] = process.exit_code
133
- stdout.rewind
134
- if(stdout.size > MAX_RESULT_SIZE)
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
@@ -1,6 +1,6 @@
1
1
  module Jackal
2
2
  module Cfn
3
3
  # Current version
4
- VERSION = Gem::Version.new('0.2.20')
4
+ VERSION = Gem::Version.new('0.2.22')
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.20
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-02-08 00:00:00.000000000 Z
11
+ date: 2016-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jackal