-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding better logging to check_service_retire method. #619
Adding better logging to check_service_retire method. #619
Conversation
Pull Request Test Coverage Report for Build 4029
💛 - Coveralls |
768623d
to
c84f181
Compare
@miq-bot add_label enhancement |
@@ -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.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor. Replace :
with a space.
@handle.log('info', "Service Retire Task <#{task.id}> <#{task.description}> is not retired, setting retry.")
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}> waiting on <#{t.request_type}> Task:<#{t.id}> <#{t.description}>") if t.state != 'finished' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@handle.log('info', "Service Retire Task <#{task.id}> is waiting on <#{t.request_type}> Task <#{t.id}> <#{t.description}>") ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or we do want to keep the space in front of Service Retire Task <#{task.id}> ...
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lfu The spaces in front of are there so it's easier to see the 'waiting' tasks. The spaces really help if you have multiple vm's or a catalog bundle. I'm not going to change this.
c84f181
to
a207a27
Compare
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}> waiting on <#{t.request_type}> Task <#{t.id}> <#{t.description}>") if t.state != 'finished' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Service Retire Task <#{task.id}> is
waiting on ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, will change this. Thanks
Now you will see the task ids, type and descriptions of tasks waiting to be retired. Service Retire Task:<10000000000118> <Service Retire for: vmware2-20191218-122517> is not retired, setting retry. Service Retire Task:<10000000000118> waiting on <vm_retire> Task:<10000000000119> <VM Retire for: Sample_Vm> Changed method name to log_task_info as requested Changed : with space as requested Changed 'waiting on' to 'is waiting on' as requested
a207a27
to
e8dda9e
Compare
Checked commit billfitzgerald0120@e8dda9e with ruby 2.5.5, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0 |
Now you will see the task ids, type and descriptions of tasks waiting to be retired.
Service Retire Task:<10000000000118> is not retired, setting retry.
Service Retire Task:<10000000000118> waiting on <vm_retire> Task:<10000000000119>
@miq-bot assign @tinaafitz