-
Notifications
You must be signed in to change notification settings - Fork 897
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
Remove options[:user_message] during miq_request_task creation. #17084
Remove options[:user_message] during miq_request_task creation. #17084
Conversation
@mkanoor Please review. |
app/models/miq_request.rb
Outdated
@@ -559,6 +559,7 @@ def my_records | |||
def clean_up_keys_for_request_task | |||
req_task_attributes = attributes.dup | |||
(req_task_attributes.keys - MiqRequestTask.column_names + REQUEST_UNIQUE_KEYS).each { |key| req_task_attributes.delete(key) } | |||
req_task_attributes["options"].delete(:user_message) if req_task_attributes["options"][:user_message] |
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.
@tinaafitz No need for the if
check here, just call the delete method unconditionally.
method calls the user_message method during approval. The request options are copied to each miq_request_task at task creation which causes a problem during update_and_notify_parent. Removing the task options[:user_message] resolves the issue. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1482197
3abbbf2
to
84a8c84
Compare
Checked commit tinaafitz@84a8c84 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
Remove options[:user_message] during miq_request_task creation. (cherry picked from commit 330eb50) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1553408
Gaprindashvili backport details:
|
Remove options[:user_message] during miq_request_task creation. (cherry picked from commit 330eb50) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1553409
Fine backport details:
|
…from_task Remove options[:user_message] during miq_request_task creation. (cherry picked from commit 330eb50) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1553409
The miq_request options[:user_message] gets added when an Automate
method calls the user_message method during approval.
The request options are copied to each miq_request_task at task creation which
causes a problem during update_and_notify_parent.
Removing the task options[:user_message] resolves the issue.
calls the update_and_notify_parent with the display_message method:
https://github.com/ManageIQ/manageiq/blob/master/app/models/miq_request_task.rb#L85
uses the user_message, if available:
https://github.com/ManageIQ/manageiq/blob/master/app/models/mixins/miq_request_mixin.rb#L13
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1482197
@miq-bot assign @gmcculloug
@miq-bot add_label bug, fine/yes, gaprindashvili/yes