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

[6.14.z] Use type(self) instead of entity class name in create methods #1146

Merged

Conversation

Satellite-QE
Copy link
Contributor

Cherrypick of PR: #1143

Description of changes

Before this PR, the entity classes that override the EntityCreateMixin.create method return a new instance of the nailgun.entities.ENTITY class. In robottelo, which wraps each entity class in the robottelo.hosts.DecClass class, this causes test failures, because satellite.api.ENTITY().create() returns an instance of robottelo.hosts.DecClass for some classes and nailgun.entities.ENTITY instances for others.

This PR updates those create methods to return an instance of type(self) instead of explicitly naming the class, so that an the same subclass / decorated class is used.

No functionality changes.

@Satellite-QE Satellite-QE added 6.14.z Auto_Cherry_Picked GHA has automatically cherrypicked this PR No-CherryPick PR doesnt need CherryPick to previous branches labels May 23, 2024
@tpapaioa tpapaioa merged commit d40d40e into 6.14.z May 28, 2024
17 checks passed
@tpapaioa tpapaioa deleted the cherry-pick-6.14.z-d5545c17d2fd32deddc9ebe69ae29c9637f76467 branch May 28, 2024 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.14.z Auto_Cherry_Picked GHA has automatically cherrypicked this PR No-CherryPick PR doesnt need CherryPick to previous branches
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants