lib/splash/daemon/orchestrator.rb in prometheus-splash-0.8.4 vs lib/splash/daemon/orchestrator.rb in prometheus-splash-0.8.5
- old
+ new
@@ -82,11 +82,11 @@
session = get_session
content[:session] = session
if VERBS.include? content[:verb]
@log.receive "Valid remote order, verb : #{content[:verb].to_s}", session
res = self.send content[:verb], content
- get_default_client.publish queue: content[:return_to], message: res.to_yaml
+ get_default_client.publish queue: content[:return_to], message: res.to_yaml unless content[:return_to] == :ignore
@log.send "Result to #{content[:return_to]}.", session
else
@log.receive "INVALID remote order, verb : #{content[:verb].to_s}", session
get_default_client.publish queue: content[:return_to], message: "Unkown verb #{content[:verb]}".to_yaml
end
@@ -153,18 +153,17 @@
end
# prepare commands Scheduling
def init_commands_scheduling
- config = get_config.commands
- commands = config.select{|key,value| value.include? :schedule}.keys
+ commands = @config.commands.select{|command| command.include? :schedule}
commands.each do |command|
- sched,value = config[command][:schedule].flatten
- @log.arrow "Scheduling command #{command.to_s}"
+ sched,value = command[:schedule].flatten
+ @log.arrow "Scheduling command #{command[:name].to_s}"
@server.send sched,value do
session = get_session
- @log.trigger "Executing Scheduled command #{command.to_s} for Scheduling : #{sched.to_s} #{value.to_s}", session
- execute command: command.to_s, session: session
+ @log.trigger "Executing Scheduled command #{command[:name].to_s} for Scheduling : #{sched.to_s} #{value.to_s}", session
+ execute command: command[:name].to_s, session: session
end
end
end