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

Fix upload_manifest to handle case where manifest.content is not set #13819

Merged

Conversation

Gauravtalreja1
Copy link
Collaborator

@Gauravtalreja1 Gauravtalreja1 commented Jan 17, 2024

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

@Gauravtalreja1 Gauravtalreja1 added Easy Fix :) Easiest Fix to review and quick merge request. CherryPick PR needs CherryPick to previous branches 6.13.z Introduced in or relating directly to Satellite 6.13 6.14.z Introduced in or relating directly to Satellite 6.14 6.15.z Introduced in or relating directly to Satellite 6.15 labels Jan 17, 2024
@Gauravtalreja1 Gauravtalreja1 self-assigned this Jan 17, 2024
@Gauravtalreja1 Gauravtalreja1 requested a review from a team as a code owner January 17, 2024 20:53
@synkd
Copy link
Contributor

synkd commented Jan 17, 2024

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"

1 similar comment
@Gauravtalreja1
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"

@jyejare
Copy link
Member

jyejare commented Jan 18, 2024

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'

@Gauravtalreja1 Gauravtalreja1 added the AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing label Jan 18, 2024
@omkarkhatavkar omkarkhatavkar merged commit 6013181 into SatelliteQE:master Jan 19, 2024
12 checks passed
github-actions bot pushed a commit that referenced this pull request Jan 19, 2024
…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)
github-actions bot pushed a commit that referenced this pull request Jan 19, 2024
…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)
github-actions bot pushed a commit that referenced this pull request Jan 19, 2024
…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)
@Gauravtalreja1 Gauravtalreja1 deleted the fix-manifester-content branch January 19, 2024 07:13
shweta83 pushed a commit to shweta83/robottelo that referenced this pull request Apr 10, 2024
…atelliteQE#13819)

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

Signed-off-by: Gaurav Talreja <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.13.z Introduced in or relating directly to Satellite 6.13 6.14.z Introduced in or relating directly to Satellite 6.14 6.15.z Introduced in or relating directly to Satellite 6.15 AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing CherryPick PR needs CherryPick to previous branches Easy Fix :) Easiest Fix to review and quick merge request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants