Skip to content
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

Merged

Conversation

billfitzgerald0120
Copy link
Contributor

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

@coveralls
Copy link

coveralls commented Dec 19, 2019

Pull Request Test Coverage Report for Build 4029

  • 5 of 5 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.006%) to 97.249%

Totals Coverage Status
Change from base Build 4022: -0.006%
Covered Lines: 3005
Relevant Lines: 3090

💛 - Coveralls

@billfitzgerald0120 billfitzgerald0120 changed the title Adding better logging to check_service_retire method. [WIP] Adding better logging to check_service_retire method. Dec 19, 2019
@miq-bot miq-bot added the wip label Dec 19, 2019
@billfitzgerald0120
Copy link
Contributor Author

@miq-bot add_label enhancement

@billfitzgerald0120 billfitzgerald0120 changed the title [WIP] Adding better logging to check_service_retire method. Adding better logging to check_service_retire method. Dec 19, 2019
@miq-bot miq-bot removed the wip label Dec 19, 2019
@@ -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.")
Copy link
Member

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'
Copy link
Member

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}>") ...

Copy link
Member

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}> ...?

Copy link
Contributor Author

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.

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'
Copy link
Member

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 ...

Copy link
Contributor Author

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
@miq-bot
Copy link
Member

miq-bot commented Dec 20, 2019

Checked commit billfitzgerald0120@e8dda9e with ruby 2.5.5, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0
1 file checked, 0 offenses detected
Everything looks fine. 🍪

@tinaafitz tinaafitz merged commit 0c84a7f into ManageIQ:master Dec 20, 2019
@tinaafitz tinaafitz added this to the Sprint 127 Ending Jan 6, 2020 milestone Dec 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants