cloud66_agent 0.0.1.pre3 → 0.0.1.pre4
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/cloud66_agent +5 -3
- data/lib/cloud66_agent/commands/address.rb +1 -1
- data/lib/cloud66_agent/commands/configure.rb +1 -1
- data/lib/cloud66_agent/commands/job_end.rb +1 -1
- data/lib/cloud66_agent/commands/job_start.rb +3 -1
- data/lib/cloud66_agent/commands/pulse.rb +1 -1
- data/lib/cloud66_agent/commands/vitals.rb +1 -1
- data/lib/cloud66_agent/utils/version.rb +1 -1
- metadata +1 -1
data/bin/cloud66_agent
CHANGED
@@ -43,7 +43,11 @@ OptionParser.new do |opts|
|
|
43
43
|
end
|
44
44
|
end.parse!
|
45
45
|
|
46
|
-
#
|
46
|
+
#pick up the command used
|
47
|
+
command = ARGV[0].downcase unless ARGV[0].nil?
|
48
|
+
|
49
|
+
# prepare the global logger (can't have stdout logging for job_start command - as the stdout result is used)
|
50
|
+
$config.log_path = "/var/log/cloud66/cloud66_agent.log" if command == 'job_start' && $config.log_path == STDOUT
|
47
51
|
$logger = Logger.new($config.log_path)
|
48
52
|
$logger.level = $config.log_level
|
49
53
|
|
@@ -53,8 +57,6 @@ if $config.disabled
|
|
53
57
|
exit -1
|
54
58
|
end
|
55
59
|
|
56
|
-
#pick up the command used
|
57
|
-
command = ARGV[0].downcase unless ARGV[0].nil?
|
58
60
|
if command.nil? || command.empty?
|
59
61
|
$logger.debug("Cloud 66 Agent v#{Cloud66::Utils::Version.current} (#{$config.is_agent_configured? ? 'Configured' : 'Not Configured'})")
|
60
62
|
exit 0
|
@@ -5,9 +5,11 @@ module Cloud66
|
|
5
5
|
class JobStart
|
6
6
|
def self.perform(job_uid)
|
7
7
|
result = Utils::Server.send_job_start job_uid
|
8
|
+
# this is the only time we need a response value from the client
|
9
|
+
puts result['session_uid']
|
8
10
|
exit 0
|
9
11
|
rescue => exc
|
10
|
-
$logger.error "job_start failed: #{exc.message}"
|
12
|
+
$logger.error "'job_start' failed: #{exc.message}"
|
11
13
|
exit -1
|
12
14
|
end
|
13
15
|
end
|