Class: HammerCLIForemanRemoteExecution::JobInvocation::OutputCommand
- Inherits:
-
HammerCLIForeman::Command
- Object
- HammerCLIForeman::Command
- HammerCLIForemanRemoteExecution::JobInvocation::OutputCommand
- Defined in:
- lib/hammer_cli_foreman_remote_execution/job_invocation.rb
Instance Method Summary collapse
Instance Method Details
#execute ⇒ Object
114 115 116 117 118 119 120 121 122 123 124 |
# File 'lib/hammer_cli_foreman_remote_execution/job_invocation.rb', line 114 def execute data = get_output if data['delayed'] puts format(_('The job is scheduled to start at %{timestamp}'), :timestamp => data['start_at']) return HammerCLI::EX_OK if option_async? end since = print_data(data) output_loop(data, since) HammerCLI::EX_OK end |
#print_data(output) ⇒ Object
103 104 105 106 107 108 109 110 111 112 |
# File 'lib/hammer_cli_foreman_remote_execution/job_invocation.rb', line 103 def print_data(output) line_set = output['output'].sort_by { |lines| lines['timestamp'].to_f } since = nil line_set.each do |line| puts line['output'] since = line['timestamp'] end since end |