cloud66_agent 0.0.1.pre5 → 0.0.1.pre6
Sign up to get free protection for your applications and to get access to all the features.
data/bin/cloud66_agent
CHANGED
@@ -3,16 +3,15 @@ require 'cloud66_agent/utils/server'
|
|
3
3
|
module Cloud66
|
4
4
|
module Commands
|
5
5
|
class JobEnd
|
6
|
-
def self.perform(status, job_uid, session_uid,
|
7
|
-
job_results = File.exists?(results_file) ? IO.
|
6
|
+
def self.perform(status, job_uid, session_uid, run_time, results_file)
|
7
|
+
job_results = File.exists?(results_file) ? IO.readlines(results_file) : []
|
8
8
|
data = {
|
9
9
|
status: status,
|
10
10
|
session_uid: session_uid,
|
11
|
-
|
11
|
+
run_time: run_time,
|
12
12
|
job_results: job_results
|
13
13
|
}
|
14
14
|
Utils::Server.send_job_end(job_uid, data)
|
15
|
-
exit 0
|
16
15
|
rescue => exc
|
17
16
|
$logger.error "'job_end' failed: #{exc.message}"
|
18
17
|
exit -1
|
data/lib/cloud66_agent.rb
CHANGED
@@ -28,9 +28,9 @@ class Cloud66Agent
|
|
28
28
|
status = args[0]
|
29
29
|
job_uid = args[1]
|
30
30
|
session_uid = args[2]
|
31
|
-
|
31
|
+
run_time = args[3]
|
32
32
|
results_file = args[4]
|
33
|
-
raise ArgumentError.new if status.nil? || job_uid.nil? || session_uid.nil? ||
|
34
|
-
Cloud66::Commands::JobEnd.perform(status, job_uid, session_uid,
|
33
|
+
raise ArgumentError.new if status.nil? || job_uid.nil? || session_uid.nil? || run_time.nil? || results_file.nil?
|
34
|
+
Cloud66::Commands::JobEnd.perform(status, job_uid, session_uid, run_time, results_file)
|
35
35
|
end
|
36
36
|
end
|