lib/splash/orchestrator/grammar.rb in prometheus-splash-0.2.0 vs lib/splash/orchestrator/grammar.rb in prometheus-splash-0.3.0

- old
+ new

@@ -13,11 +13,11 @@ def list_commands return get_config.commands end - def ack_command + def ack_command(payload) return self.execute command: payload[:name], ack: true end def execute_command(payload) @@ -25,18 +25,21 @@ puts " * Command not found" return { :case => :not_found } end if payload.include? :schedule then sched,value = payload[:schedule].flatten + puts " * Schedule remote call command #{payload[:name]}, scheduling : #{sched.to_s} #{value}" + @server.send sched,value do + self.execute command: payload[:name] + end + return { :case => :quiet_exit } else - sched = :in - value = '1s' + puts " * Execute direct command" + puts payload[:name] + res = self.execute command: payload[:name] + puts res.inspect + return res end - puts " * Schedule remote call command #{payload[:name]}, scheduling : #{sched.to_s} #{value}" - @server.send sched,value do - self.execute command: payload[:name] - end - return { :case => :quiet_exit } end end end end