-
Notifications
You must be signed in to change notification settings - Fork 32
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 Katello product resource API call #142
Fix Katello product resource API call #142
Conversation
foreman_katello_product used an old wrapper that did not include location_id and organization_id in the payload of calls towards the API. Resolves terraform-coop#54 Signed-off-by: Dominik Pataky <pataky@mindful-security.eu>
On the way to fix the creation, modification and deletion of Katello products, it turned out that Katello uses async responses in its API. Specifically, the destroy (DELETE) endpoints return an async task, which must be checked for completion. This check is now implemented. If a product is destroyed, the API client detects the usage of foreman_tasks and invokes a routine to check the task by its ID, waiting for it to finish. Signed-off-by: Dominik Pataky <pataky@mindful-security.eu>
Signed-off-by: Dominik Pataky <pataky@mindful-security.eu>
As seen in https://apidocs.theforeman.org/katello/latest/apidoc/v2/products.html, the organization_id is a required parameter for the GET endpoint. It is now sent with the name query term. Signed-off-by: Dominik Pataky <pataky@mindful-security.eu>
Signed-off-by: Dominik Pataky <pataky@mindful-security.eu>
This one's ready for its purpose to fix the katello product resource calls. It also adds handling for the async "ForemanTask" objects, which are the return type in the Katello API. To not further bloat this PR, I will continue on another branch for #141 |
@lhw would you like me to split the PR into two separate PRs, one containing the fix for katello_product and the other for the Katello async ForemanTasks? |
Signed-off-by: Dominik Pataky <pataky@mindful-security.eu>
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.
No. It's fine. Terraform can't really do async by nature. So waiting for a response to a started task is the right way to handle it.
Hello, Any news on the progress of this PR ? Regards, |
Merged, had no conflicts - feel free to test in your environment @lukry59 ! |
foreman_katello_product used an old wrapper that did not include location_id and organization_id in the payload of calls towards the API.
Resolves #54