[6.18.z] Fix OSP compute resource cleanup - #22229
Merged
Satellite-QE merged 1 commit intoJul 23, 2026
Merged
Conversation
* Fix OSP compute resource cleanup * delete by both name and id --------- Co-authored-by: Arvind Jangir <ajangir@redhat.com> (cherry picked from commit 600d953)
Collaborator
Author
|
Collaborator
Author
|
PRT Result |
Satellite-QE
deleted the
cherry-pick-6.18.z-600d95371fe1655c7caea3077705f670d6ec8204
branch
July 23, 2026 08:25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherrypick of PR: #22170
Problem Statement
The OSP compute resource cleanup finalizer was buggy: it always received the CR numeric id, but used the parametrized id_type (id or name) as the delete/search key. For the name parametrization this became delete({'name': '<numeric_id>'}), so cleanup could fail silently. Failed deletes were swallowed with bare pass, which made leaked Satellite CRs (and related OSP SSH key pairs) hard to notice.
Solution
Always delete and verify the compute resource by id in cr_cleanup, and log a warning when deletion fails so leftover CRs/key pairs are visible in test logs.
PRT test Cases example
trigger: test-robottelo
pytest: tests/foreman/cli/test_computeresource_osp.py -k test_crud_and_duplicate_name
Summary by Sourcery
Fix OSP compute resource cleanup in tests to always delete by numeric ID and surface failures via logging.
Bug Fixes:
Enhancements:
Tests: