Skip to content

Commit

Permalink
Merge pull request #13751 from tinaafitz/add_service_action
Browse files Browse the repository at this point in the history
Resource action - Add service_action.
  • Loading branch information
mkanoor authored Feb 7, 2017
2 parents a0d42cf + 4c293b4 commit ad522ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/models/service_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,9 @@ def create_resource_actions(ae_endpoints)
ae_endpoint[:fqname]
end

build_options = {:action => action[:name], :fqname => fqname}
build_options = {:action => action[:name],
:fqname => fqname,
:ae_attributes => {:service_action => action[:name]}}
build_options.merge!(ae_endpoint.slice(:dialog,
:dialog_id,
:configuration_template,
Expand Down
1 change: 1 addition & 0 deletions spec/models/service_template_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,7 @@
expect(service_template.service_resources.first.resource_type).to eq('MiqRequest')
expect(service_template.dialogs.first).to eq(service_dialog)
expect(service_template.resource_actions.pluck(:action)).to include('Provision', 'Retirement')
expect(service_template.resource_actions.pluck(:ae_attributes)).to include({:service_action=>"Provision"}, {:service_action=>"Retirement"})
expect(service_template.resource_actions.first.dialog).to eq(service_dialog)
expect(service_template.resource_actions.last.dialog).to eq(service_dialog)
end
Expand Down

0 comments on commit ad522ca

Please sign in to comment.