-
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
Set the initiator from the workflow/request #14070
Conversation
@tinaafitz @gmcculloug |
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.
app/models/miq_action.rb
Outdated
@@ -799,7 +806,7 @@ def action_cancel_task(action, rec, inputs) | |||
end | |||
|
|||
MiqPolicy.logger.info("MIQ(action_cancel_task): Now executing Cancel of task [#{source_event.event_type}] on VM [#{source_event.vm_name}]") | |||
ems = ExtManagementSystem.find_by(:id => source_event.ems_id) | |||
ems = ExtManagementSystem.find_by_id(source_event.ems_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 are you changing this? There have been a number of PRs merged to use the other form: https://github.com/ManageIQ/manageiq/pulls?utf8=%E2%9C%93&q=is%3Apr%20author%3Achessbyte%20is%3Aclosed%20find_by
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.
@gmcculloug
since i need the miq_action changes i might have picked up extra changes from master. in only need the line 228 update
@mkanoor Looks good. |
This pull request is not mergeable. Please rebase and repush. |
514b54d
to
9efba3a
Compare
@gmcculloug |
@@ -113,6 +113,16 @@ | |||
end | |||
end | |||
|
|||
context "initiator" do |
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.
@mkanoor Do we have any tests for when :initiator
is not passed or when it is passed as nil
? If the key is passed with a nil
value I think it will save nil in the record instead of using the default value.
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.
@gmcculloug Yes that was an issue, I fixed it
Checked commits mkanoor/manageiq@9efba3a~...1c171b8 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
@gmcculloug Please review |
@@ -187,6 +187,8 @@ def create_service(service_task, parent_svc = nil) | |||
# convert template class name to service class name by naming convention | |||
nh[:type] = self.class.name.sub('Template', '') | |||
|
|||
nh[:initiator] = service_task.options[:initiator] if service_task.options[:initiator] |
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.
@gmcculloug
If the value is nil we don't set the initiator causing the default value of user to be used.
Set the initiator in the workflow and request
Depends on #14035