Skip to content

Commit

Permalink
Merge pull request #3035 from jntullo/remove_action_controller_params
Browse files Browse the repository at this point in the history
Do not pass in all action controller params to raw_connect
  • Loading branch information
martinpovolny authored Dec 23, 2017
2 parents d4b7f57 + 748a4ef commit 0a2efb0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/controllers/mixins/ems_common_angular.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ module Mixins
module EmsCommonAngular
extend ActiveSupport::Concern

OPENSTACK_PARAMS = [:name, :provider_region, :api_version, :default_security_protocol, :keystone_v3_domain_id, :default_hostname, :default_api_port, :default_userid, :event_stream_selection].freeze

included do
include Mixins::GenericFormMixin
end
Expand Down Expand Up @@ -115,7 +117,7 @@ def get_task_args(ems)
user, password = params[:default_userid], MiqPassword.encrypt(params[:default_password])
case ems.to_s
when 'ManageIQ::Providers::Openstack::CloudManager'
[password, params.except(:default_password)]
[password, params.to_hash.symbolize_keys.slice(*OPENSTACK_PARAMS)]
when 'ManageIQ::Providers::Amazon::CloudManager'
[user, password, :EC2, params[:provider_region], nil, true]
when 'ManageIQ::Providers::Azure::CloudManager'
Expand All @@ -136,7 +138,7 @@ def get_task_args(ems)

[ems.build_connect_params(connect_opts), true]
when 'ManageIQ::Providers::Openstack::InfraManager'
[password, params.except(:default_password)]
[password, params.to_hash.symbolize_keys.slice(*(OPENSTACK_PARAMS))]
when 'ManageIQ::Providers::Redhat::InfraManager'
metrics_user, metrics_password = params[:metrics_userid], MiqPassword.encrypt(params[:metrics_password])
[{
Expand Down

0 comments on commit 0a2efb0

Please sign in to comment.