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 AK update tests - org required #13364

Merged
merged 1 commit into from
Dec 11, 2023
Merged

Conversation

vsedmik
Copy link
Contributor

@vsedmik vsedmik commented Dec 11, 2023

Problem Statement

It is required to provide organization_id for AK update (see apidoc and the related nailgun PR). Failure:

tests/foreman/api/test_activationkey.py:244: in test_negative_update_name
    target_sat.api.ActivationKey(id=act_key.id, name=new_name).update(['name'])
../../lib64/python3.11/site-packages/nailgun/entity_mixins.py:1076: in update
    return self.read(attrs=self.update_json(fields))
../../lib64/python3.11/site-packages/nailgun/entity_mixins.py:1052: in update_json
    response = self.update_raw(fields)
../../lib64/python3.11/site-packages/nailgun/entity_mixins.py:1034: in update_raw
    self.update_payload(fields),
../../lib64/python3.11/site-packages/nailgun/entities.py:277: in update_payload
    payload['organization_id'] = self.organization.id
E   AttributeError: 'DecClass' object has no attribute 'organization'

Solution

Provide an Organization on AK create and update.

Related Issues

SatelliteQE/nailgun#992

@vsedmik vsedmik added Easy Fix :) Easiest Fix to review and quick merge request. CherryPick PR needs CherryPick to previous branches 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 Dec 11, 2023
@vsedmik vsedmik self-assigned this Dec 11, 2023
@vsedmik vsedmik requested a review from a team as a code owner December 11, 2023 11:04
@vsedmik
Copy link
Contributor Author

vsedmik commented Dec 11, 2023

trigger: test-robottelo
pytest: tests/foreman/api/test_activationkey.py -k update

@vijaysawant
Copy link
Contributor

Looks good to me, easy fix

@vsedmik vsedmik added the AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing label Dec 11, 2023
@vijaysawant vijaysawant merged commit 87f501f into SatelliteQE:master Dec 11, 2023
11 checks passed
github-actions bot pushed a commit that referenced this pull request Dec 11, 2023
github-actions bot pushed a commit that referenced this pull request Dec 11, 2023
vsedmik added a commit that referenced this pull request Dec 11, 2023
Fix AK update tests - org required (#13364)

(cherry picked from commit 87f501f)

Co-authored-by: vsedmik <46570670+vsedmik@users.noreply.github.com>
vsedmik added a commit that referenced this pull request Dec 11, 2023
Fix AK update tests - org required (#13364)

(cherry picked from commit 87f501f)

Co-authored-by: vsedmik <46570670+vsedmik@users.noreply.github.com>
damoore044 pushed a commit to damoore044/robottelo that referenced this pull request Dec 11, 2023
shweta83 pushed a commit to shweta83/robottelo that referenced this pull request Apr 10, 2024
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 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.

3 participants