-
Notifications
You must be signed in to change notification settings - Fork 284
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
Fixes #36528 - handle integer hash keys in katello-agent actions #10627
Merged
jeremylenz
merged 1 commit into
Katello:master
from
jeremylenz:36528-bulk-agent-actions-broken
Jun 30, 2023
Merged
Fixes #36528 - handle integer hash keys in katello-agent actions #10627
jeremylenz
merged 1 commit into
Katello:master
from
jeremylenz:36528-bulk-agent-actions-broken
Jun 30, 2023
Conversation
This file contains 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
Issues: #36528 |
jeremylenz
commented
Jun 22, 2023
jeremylenz
force-pushed
the
36528-bulk-agent-actions-broken
branch
from
June 22, 2023 18:31
5b1c2cc
to
bc9accc
Compare
chris1984
reviewed
Jun 30, 2023
jeremylenz
force-pushed
the
36528-bulk-agent-actions-broken
branch
from
June 30, 2023 20:40
bc9accc
to
891de3d
Compare
@chris1984 added comment 👍 |
lfu
approved these changes
Jun 30, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍🏻
lfu
pushed a commit
to lfu/katello
that referenced
this pull request
Jul 12, 2023
…ello#10627) (cherry picked from commit f9bf7d0)
lfu
pushed a commit
that referenced
this pull request
Jul 12, 2023
) (cherry picked from commit f9bf7d0)
wbclark
pushed a commit
to wbclark/katello
that referenced
this pull request
Sep 7, 2023
…ello#10627) (cherry picked from commit f9bf7d0)
wbclark
pushed a commit
that referenced
this pull request
Sep 27, 2023
) (cherry picked from commit f9bf7d0)
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.
What are the changes introduced in this pull request?
For some reason,
args[:dispatch_histories]
is ending up with integer keys, but the code was expecting string keys. This caused no sub-plans to be created for any Katello-agent bulk action.I changed the code to handle both string and integer hash keys. After doing this, I noticed that the action would succeed on the host, but the task would still fail:
This was because
Katello::AgentAction#plan
was still expectingoptions[:dispatch_histories]
to have string keys. I changed that to handle both string and integer as well.Considerations taken when implementing this change?
Originally I had just changed
.to_s
to.to_i
, but realized I don't necessarily know for sure all the code paths that createKatello::Agent::DispatchHistory
s. Figured it was safer to handle both data types.What are the testing steps for this pull request?
Set up katello-agent:
Administer > Settings > Content > Use remote execution by default > No
Enable the RH Client repo
Install katello-agent on a host
Test basic setup: Hosts > All Hosts > your host > Packages > kebab > Install packages > Install "via katello-agent"
Task should succeed.
Test bulk actions:
Hosts > Content Hosts > Select your host (you don't need more than one) > Select action > Manage Packages > type a package name > Install > via katello-agent
Before: Task fails and Dynflow console for the task shows no subplans.
After: Task succeeds with no errors. Bulk action shows sub-plans for each host.