-
Notifications
You must be signed in to change notification settings - Fork 3.5k
AAP-39365 facts are unintentionally deleted when the inventory is modified during a job execution #15910
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
Conversation
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found. 🚀 New features to boost your workflow:
|
19cea6d
to
cf9a38c
Compare
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.
I filed AAP-43462 as the followup issue to this one.
140805b
to
cff5dd7
Compare
328d66c
to
b6e57f9
Compare
…e undesired behaviour with fact cache Signed-off-by: onetti7 <[email protected]>
…e undesired behaviour with fact cache Signed-off-by: onetti7 <[email protected]>
Signed-off-by: onetti7 <[email protected]>
Signed-off-by: onetti7 <[email protected]>
3525f13
to
4bd99dc
Compare
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.
Does this need a Yolo run attached to it?
4bd99dc
to
ffff1b8
Compare
Remove now unused line of code which was commented out by the contributor Revert "Remove now unused line of code which was commented out by the contributor" This reverts commit f1a056a.
…ecific to the particular slice when applicable Revise private_data_dir fixture to see if it improves code coverage Checked out awx/main/tests/unit/models/test_jobs.py in devel to see if it resolves git diff issue
Rename for loop from host in hosts to hosts in hosts_cahced and remove unneeded continue Revise finish_fact_cache to utilize inventory rather than hosts Remove local var hosts that was assigned but unused Revert change in start_fact_cache hosts_cached back to hosts Revise the way we are handling hosts_cached and joining the file Revert "Revise the way we are handling hosts_cached and joining the file" This reverts commit e6e3d2f. Reapply "Revise the way we are handling hosts_cached and joining the file" This reverts commit a42b7ae. Revert some of my changes to get back to a better working state Rename for loop to host in hosts_cached and remove unneeded continue Remove jobs job.get_hosts_for_fact_cache() from post run hook, fix if statement after continue block, and revise how we are calling hosts in finish for loop Add test_invalid_host_facts to test_jobs to increase code coverage Update method signature to use hosts_cached and updated other references to hosts in finish_facts_cached Rename hosts iterator to hosts_cached to agree with naming elsewhere Revise test_invalid_host_facts to get more code coverage Revise test_invalid_host_facts to increase codecov Revise test_pre_post_run_hook_facts_deleted_sliced to ensure we are hitting the assertionerror for code cov Revise mock_inventory.hosts. to hit assert failure Add revision of hosts and facts to force failure to satisfy code cov Fix failure in test_pre_post_run_hook_facts_deleted_sliced Add back for loop to create failures and add assert to hit them Remove hosts.iterator() from both start_fact_cache and finish_fact_cache Remove unused import of Queryset to satisfy api-lint Fix typo in docstring hasnot to has not Move hosts_cached.append(host) to outer loop in start_fact_cache Add class to help support cached hosts resolving host.name issue with hosts_cached
Remove fixture needed for local work only maybe Revert "Add class to help support cached hosts resolving host.name issue with hosts_cached" This reverts commit 99d998c.
ffff1b8
to
9de0763
Compare
…_when_the_inventory_is_modified_during_a_Job_execution
|
…ified during a job execution (ansible#15910) * Added test_jobs.py to the model unit test folder in orther to show the undesired behaviour with fact cache Signed-off-by: onetti7 <[email protected]> * Added test_jobs.py to the model unit test folder in orther to show the undesired behaviour with fact cache Signed-off-by: onetti7 <[email protected]> * Solved undesired behaviour with fact_cache Signed-off-by: onetti7 <[email protected]> * Solved bug with slices Signed-off-by: onetti7 <[email protected]> * Remove unused imports Remove now unused line of code which was commented out by the contributor Revert "Remove now unused line of code which was commented out by the contributor" This reverts commit f1a056a. * Add back line that had been commented out as this line makes hosts specific to the particular slice when applicable Revise private_data_dir fixture to see if it improves code coverage Checked out awx/main/tests/unit/models/test_jobs.py in devel to see if it resolves git diff issue * Fix formatting in awx/main/tests/unit/models/test_jobs.py Rename for loop from host in hosts to hosts in hosts_cahced and remove unneeded continue Revise finish_fact_cache to utilize inventory rather than hosts Remove local var hosts that was assigned but unused Revert change in start_fact_cache hosts_cached back to hosts Revise the way we are handling hosts_cached and joining the file Revert "Revise the way we are handling hosts_cached and joining the file" This reverts commit e6e3d2f. Reapply "Revise the way we are handling hosts_cached and joining the file" This reverts commit a42b7ae. Revert some of my changes to get back to a better working state Rename for loop to host in hosts_cached and remove unneeded continue Remove jobs job.get_hosts_for_fact_cache() from post run hook, fix if statement after continue block, and revise how we are calling hosts in finish for loop Add test_invalid_host_facts to test_jobs to increase code coverage Update method signature to use hosts_cached and updated other references to hosts in finish_facts_cached Rename hosts iterator to hosts_cached to agree with naming elsewhere Revise test_invalid_host_facts to get more code coverage Revise test_invalid_host_facts to increase codecov Revise test_pre_post_run_hook_facts_deleted_sliced to ensure we are hitting the assertionerror for code cov Revise mock_inventory.hosts. to hit assert failure Add revision of hosts and facts to force failure to satisfy code cov Fix failure in test_pre_post_run_hook_facts_deleted_sliced Add back for loop to create failures and add assert to hit them Remove hosts.iterator() from both start_fact_cache and finish_fact_cache Remove unused import of Queryset to satisfy api-lint Fix typo in docstring hasnot to has not Move hosts_cached.append(host) to outer loop in start_fact_cache Add class to help support cached hosts resolving host.name issue with hosts_cached * Add live tests for ansible facts Remove fixture needed for local work only maybe Revert "Add class to help support cached hosts resolving host.name issue with hosts_cached" This reverts commit 99d998c. * Move hosts_cached.append(host) outside of try except * Move hosts_cached.append(host) to the beginning of start_fact_cache --------- Signed-off-by: onetti7 <[email protected]> Co-authored-by: onetti7 <[email protected]> Co-authored-by: Alan Rominger <[email protected]>
…ified during a job execution (ansible#15910) * Added test_jobs.py to the model unit test folder in orther to show the undesired behaviour with fact cache Signed-off-by: onetti7 <[email protected]> * Added test_jobs.py to the model unit test folder in orther to show the undesired behaviour with fact cache Signed-off-by: onetti7 <[email protected]> * Solved undesired behaviour with fact_cache Signed-off-by: onetti7 <[email protected]> * Solved bug with slices Signed-off-by: onetti7 <[email protected]> * Remove unused imports Remove now unused line of code which was commented out by the contributor Revert "Remove now unused line of code which was commented out by the contributor" This reverts commit f1a056a. * Add back line that had been commented out as this line makes hosts specific to the particular slice when applicable Revise private_data_dir fixture to see if it improves code coverage Checked out awx/main/tests/unit/models/test_jobs.py in devel to see if it resolves git diff issue * Fix formatting in awx/main/tests/unit/models/test_jobs.py Rename for loop from host in hosts to hosts in hosts_cahced and remove unneeded continue Revise finish_fact_cache to utilize inventory rather than hosts Remove local var hosts that was assigned but unused Revert change in start_fact_cache hosts_cached back to hosts Revise the way we are handling hosts_cached and joining the file Revert "Revise the way we are handling hosts_cached and joining the file" This reverts commit e6e3d2f. Reapply "Revise the way we are handling hosts_cached and joining the file" This reverts commit a42b7ae. Revert some of my changes to get back to a better working state Rename for loop to host in hosts_cached and remove unneeded continue Remove jobs job.get_hosts_for_fact_cache() from post run hook, fix if statement after continue block, and revise how we are calling hosts in finish for loop Add test_invalid_host_facts to test_jobs to increase code coverage Update method signature to use hosts_cached and updated other references to hosts in finish_facts_cached Rename hosts iterator to hosts_cached to agree with naming elsewhere Revise test_invalid_host_facts to get more code coverage Revise test_invalid_host_facts to increase codecov Revise test_pre_post_run_hook_facts_deleted_sliced to ensure we are hitting the assertionerror for code cov Revise mock_inventory.hosts. to hit assert failure Add revision of hosts and facts to force failure to satisfy code cov Fix failure in test_pre_post_run_hook_facts_deleted_sliced Add back for loop to create failures and add assert to hit them Remove hosts.iterator() from both start_fact_cache and finish_fact_cache Remove unused import of Queryset to satisfy api-lint Fix typo in docstring hasnot to has not Move hosts_cached.append(host) to outer loop in start_fact_cache Add class to help support cached hosts resolving host.name issue with hosts_cached * Add live tests for ansible facts Remove fixture needed for local work only maybe Revert "Add class to help support cached hosts resolving host.name issue with hosts_cached" This reverts commit 99d998c. * Move hosts_cached.append(host) outside of try except * Move hosts_cached.append(host) to the beginning of start_fact_cache --------- Signed-off-by: onetti7 <[email protected]> Co-authored-by: onetti7 <[email protected]> Co-authored-by: Alan Rominger <[email protected]>
…ified during a job execution (#15910) (#6905) * Added test_jobs.py to the model unit test folder in orther to show the undesired behaviour with fact cache * Added test_jobs.py to the model unit test folder in orther to show the undesired behaviour with fact cache * Solved undesired behaviour with fact_cache * Solved bug with slices * Remove unused imports Remove now unused line of code which was commented out by the contributor Revert "Remove now unused line of code which was commented out by the contributor" This reverts commit f1a056a. * Add back line that had been commented out as this line makes hosts specific to the particular slice when applicable Revise private_data_dir fixture to see if it improves code coverage Checked out awx/main/tests/unit/models/test_jobs.py in devel to see if it resolves git diff issue * Fix formatting in awx/main/tests/unit/models/test_jobs.py Rename for loop from host in hosts to hosts in hosts_cahced and remove unneeded continue Revise finish_fact_cache to utilize inventory rather than hosts Remove local var hosts that was assigned but unused Revert change in start_fact_cache hosts_cached back to hosts Revise the way we are handling hosts_cached and joining the file Revert "Revise the way we are handling hosts_cached and joining the file" This reverts commit e6e3d2f. Reapply "Revise the way we are handling hosts_cached and joining the file" This reverts commit a42b7ae. Revert some of my changes to get back to a better working state Rename for loop to host in hosts_cached and remove unneeded continue Remove jobs job.get_hosts_for_fact_cache() from post run hook, fix if statement after continue block, and revise how we are calling hosts in finish for loop Add test_invalid_host_facts to test_jobs to increase code coverage Update method signature to use hosts_cached and updated other references to hosts in finish_facts_cached Rename hosts iterator to hosts_cached to agree with naming elsewhere Revise test_invalid_host_facts to get more code coverage Revise test_invalid_host_facts to increase codecov Revise test_pre_post_run_hook_facts_deleted_sliced to ensure we are hitting the assertionerror for code cov Revise mock_inventory.hosts. to hit assert failure Add revision of hosts and facts to force failure to satisfy code cov Fix failure in test_pre_post_run_hook_facts_deleted_sliced Add back for loop to create failures and add assert to hit them Remove hosts.iterator() from both start_fact_cache and finish_fact_cache Remove unused import of Queryset to satisfy api-lint Fix typo in docstring hasnot to has not Move hosts_cached.append(host) to outer loop in start_fact_cache Add class to help support cached hosts resolving host.name issue with hosts_cached * Add live tests for ansible facts Remove fixture needed for local work only maybe Revert "Add class to help support cached hosts resolving host.name issue with hosts_cached" This reverts commit 99d998c. * Move hosts_cached.append(host) outside of try except * Move hosts_cached.append(host) to the beginning of start_fact_cache --------- Signed-off-by: onetti7 <[email protected]> Co-authored-by: onetti7 <[email protected]> Co-authored-by: Alan Rominger <[email protected]>
SUMMARY
This change fixes facts are unintentionally deleted when the inventory is modified during a job execution
ISSUE TYPE
COMPONENT NAME
AWX VERSION
ADDITIONAL INFORMATION