diff --git a/app/models/manageiq/providers/lenovo/manager_mixin.rb b/app/models/manageiq/providers/lenovo/manager_mixin.rb index 887690f1db..125dc13b6d 100644 --- a/app/models/manageiq/providers/lenovo/manager_mixin.rb +++ b/app/models/manageiq/providers/lenovo/manager_mixin.rb @@ -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 = {}) @@ -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