Skip to content

Commit

Permalink
Added the user_agent when is creating the connection
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlleDaniel committed Oct 30, 2017
1 parent 56cf327 commit b02ea0d
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions app/models/manageiq/providers/lenovo/manager_mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ def connect(options = {})
host = options[:host] || address
port = options[:port] || self.port
auth_type = AUTH_TYPES[options[:auth_type]]
user_agent_label = "ManageIQ/#{MiqServer.first .version}"

# TODO: improve this SSL verification
verify_ssl = options[:verify_ssl] == 1 ? 'PEER' : 'NONE'
self.class.raw_connect(username, password, host, port, auth_type, verify_ssl)
self.class.raw_connect(username, password, host, port, auth_type, verify_ssl, user_agent_label)
end

def verify_credentials(auth_type = nil, options = {})
Expand All @@ -39,14 +40,15 @@ def verify_credentials(auth_type = nil, options = {})
end

module ClassMethods
def raw_connect(username, password, host, port, auth_type, verify_ssl)
def raw_connect(username, password, host, port, auth_type, verify_ssl, user_agent_label)
xclarity = XClarityClient::Configuration.new(
:username => username,
:password => password,
:host => host,
:port => port,
:auth_type => auth_type,
:verify_ssl => verify_ssl
:username => username,
:password => password,
:host => host,
:port => port,
:auth_type => auth_type,
:verify_ssl => verify_ssl,
:user_agent_label => user_agent_label,
)
XClarityClient::Client.new(xclarity)
end
Expand Down

0 comments on commit b02ea0d

Please sign in to comment.