From 8c2175d8909459bea34a83676defdce21ef8d033 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Fri, 18 Apr 2014 01:55:37 +0400 Subject: [PATCH] #376: save output --- app/models/node_instruction.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/models/node_instruction.rb b/app/models/node_instruction.rb index b720ebda4..7fef37bfe 100644 --- a/app/models/node_instruction.rb +++ b/app/models/node_instruction.rb @@ -52,11 +52,11 @@ class NodeInstruction < ActiveRecord::Base restart_failed if NodeInstruction.all_locked? success = false - output = '' + stdout = '' instruction.lines.each do |command| next if command.blank? command.chomp!; command.strip! - output << %x[ #{command} 2>&1 ] + stdout << %x[ #{command} 2>&1 ] success = $?.success? end @@ -68,6 +68,7 @@ class NodeInstruction < ActiveRecord::Base bl.restart_job end + update_column(:output, stdout) success ? ready : restart_failed end later :perform_restart, queue: :low