-
Notifications
You must be signed in to change notification settings - Fork 143
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
Use destroy_queue for provider delete #217
Use destroy_queue for provider delete #217
Conversation
cc @durandom |
raise BadRequestError, "Must specify an id for deleting a #{type} resource" unless id | ||
provider = resource_search(id, type, collection_class(type)) | ||
task = provider.class.schedule_destroy_queue(provider.id) | ||
action_result(true, "#{provider_ident(provider)} deleting", :task_id => task.id) |
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.
I think you should use destroy_queue
instead of schedule_destroy_queue
because it also schedules the destroy
of child managers
@miq-bot assign @abellotti |
Changes to ExtManagementSystem now require the use of destroy_queue to queue the deletion of the provider. Without this change, provider deletion is silently failing due to a before_hook on destroy that checks if there are any active queues for the provider. The orchestrate_delete method that will now be called will resolve this. https://bugzilla.redhat.com/show_bug.cgi?id=1501941
Checked commit jntullo@e91c02a with ruby 2.3.3, rubocop 0.47.1, haml-lint 0.20.0, and yamllint 1.10.0 |
raise BadRequestError, "Must specify an id for deleting a #{type} resource" unless id | ||
provider = resource_search(id, type, collection_class(type)) | ||
task = provider.destroy_queue | ||
action_result(true, "#{provider_ident(provider)} deleting", :task_id => task.id, :parent_id => id) |
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.
why the parent_id here ? that's different behavior than the old destroy_provider method.
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.
@abellotti yeah, I'm confused as to how it was returning the href
, because unless the parent_id
is specified, it wasn't.
Use destroy_queue for provider delete (cherry picked from commit 4d00d26) https://bugzilla.redhat.com/show_bug.cgi?id=1515449
Gaprindashvili backport details:
|
Changes to ExtManagementSystem now require the use of schedule_destroy_queue to queue the deletion of the provider. Without this change, provider deletion is silently failing due to a before_hook on destroy that checks if there are any active queues for the provider. The orchestrate_delete method that will now be called will resolve this.
https://bugzilla.redhat.com/show_bug.cgi?id=1501941
@miq-bot add_label bug, gaprindashvili/yes, blocker
cc: @gtanzillo @zeari