-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Fixed the Customized Notification returning incorrect values for host_status_counts #9251
Fixed the Customized Notification returning incorrect values for host_status_counts #9251
Conversation
Build failed.
|
Build failed.
|
Build failed.
|
Looks like some tests need to be updated
you can run those tests individually in the dev environment:
|
Sure, I'm on it. |
Build failed.
|
Looks like I was wrong about the if condition. Without it, an inventory update notification will fail on the line
|
I don't think it is failing because we removed the if condition. It because the InventoryUpdate is not aware of event . We may need to filter those out, the InventoryUpdate and WorkflowJob ?? |
Build succeeded.
|
recheck |
regate |
Build succeeded.
|
Fixed the customized notification returning incorrect values for host_status_counts Update notifications.py Removed if condition Added exception handling A nitpick
805cbc8
to
6aca9d8
Compare
Build succeeded.
|
(closed and reopened to get zuul working) |
Build succeeded.
|
Build failed (gate pipeline). For information on how to proceed, see
|
regate |
Build succeeded (gate pipeline).
|
Fixed the customized notification returning incorrect values for host_status_counts. Summarizing the issue in the following
SUMMARY
When running a Job Template with a customized notification associated with it, it is returning incorrect values for host_status_counts in SLACK channel. I could see that in the code that we are taking the values for host_status_counts from job_host_summaries for the first rack than taking it from the /api/v2/jobs/ID.
The values shows in /api/v2/jobs/ID look perfectly correct to me than what shows in /api/v2/jobs/ID/job_host_summaries. In the job_host_summaries we calculate the host_status_counts values for dark,ok, processed, etc. individually for different hosts. And right now we are taking host_status_counts from the first rack of the job_host_summaries rather than just taking it from /api/v2/jobs/ID host_status_counts which is calculated correctly. Looking at the job_host_summaries API output I think we are taking the values from the first rack of job_host_summaries
ISSUE TYPE
COMPONENT NAME
AWX VERSION
ADDITIONAL INFORMATION
With the PR, we could see the correct values are getting received in SLACK notifications.
Following data is from /api/v2/jobs/185 for host_status_counts