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] Fix upload_manifest to handle case where manifest.content is not set #13835

Conversation

Satellite-QE
Copy link
Collaborator

Cherrypick of PR: #13819

Problem Statement

Currently, there are many intermittent test failures like below where we use module_sca_manifest_org are seen in automation runs, where we don't have content property set in manifester object.

pytest_fixtures/component/taxonomy.py:102: in module_sca_manifest_org
    module_target_sat.upload_manifest(module_org.id, module_sca_manifest.content)
robottelo/host_helpers/satellite_mixins.py:149: in upload_manifest
    if manifest.content is None:
E   AttributeError: 'NoneType' object has no attribute 'content'

Solution

Update upload_manifest to handle case where manifest.content is not set, or when manifest.content is None

Local test results:

In [3]: manifest = Manifester(manifest_category=settings.manifest.golden_ticket)

In [4]: manifest.content
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[4], line 1
----> 1 manifest.content

AttributeError: 'Manifester' object has no attribute 'content'

In [5]: hasattr(manifest, 'content')
Out[5]: False

In [6]: not hasattr(manifest, 'content') or manifest.content is None
Out[6]: True

In [7]: manifest.content = None

In [8]: not hasattr(manifest, 'content') or manifest.content is None
Out[8]: True

…13819)

Update upload_manifest to handle case where manifest.content is not set

Signed-off-by: Gaurav Talreja <[email protected]>
(cherry picked from commit 6013181)
@Satellite-QE Satellite-QE added 6.14.z Introduced in or relating directly to Satellite 6.14 Auto_Cherry_Picked Automatically cherrypicked PR using GHA No-CherryPick PR doesnt need CherryPick to previous branches labels Jan 19, 2024
@Satellite-QE
Copy link
Collaborator Author

trigger: test-robottelo
pytest: tests/foreman/cli/test_activationkey.py tests/foreman/api/test_subscription.py tests/foreman/cli/test_contentaccess.py -k 'test_positive_add_redhat_product or test_negative_upload or test_negative_rct_not_shows_golden_ticket_enabled'

@Satellite-QE Satellite-QE added the AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing label Jan 19, 2024
@Satellite-QE Satellite-QE merged commit 89a5ad0 into 6.14.z Jan 19, 2024
22 checks passed
@Satellite-QE Satellite-QE deleted the cherry-pick-6.14.z-60131818ac9574a78f118a2fbcd62d9773045ea0 branch January 19, 2024 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.14.z Introduced in or relating directly to Satellite 6.14 Auto_Cherry_Picked Automatically cherrypicked PR using GHA AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing No-CherryPick PR doesnt need CherryPick to previous branches
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants