Skip to content

Commit

Permalink
Merge pull request #619 from billfitzgerald0120/check_service_retire_…
Browse files Browse the repository at this point in the history
…add_logging

Adding better logging to check_service_retire method.
  • Loading branch information
tinaafitz committed Dec 20, 2019
2 parents ae057c8 + e8dda9e commit 0c84a7f
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ def main

private

def log_task_info(task)
@handle.log('info', "Service Retire Task <#{task.id}> <#{task.description}> is not retired, setting retry.")
task.miq_request_tasks.each do |t|
@handle.log('info', " Service Retire Task <#{task.id}> is waiting on <#{t.request_type}> Task <#{t.id}> <#{t.description}>") if t.state != 'finished'
end
end

def check_all_service_tasks
task = @handle.root['service_retire_task']
task_status = task['status']
Expand All @@ -35,7 +42,7 @@ def check_all_service_tasks
reason = reason[7..-1] if reason[0..6] == 'Error: '
@handle.root['ae_reason'] = reason
when 'retry'
@handle.log('info', "Service task #{task.description} is not retired, setting retry.")
log_task_info(task)
@handle.root['ae_result'] = 'retry'
@handle.root['ae_retry_interval'] = '1.minute'
when 'ok'
Expand Down

0 comments on commit 0c84a7f

Please sign in to comment.