Skip to content

Commit a6869a6

Browse files
committed
Change the default user_agent string to the one required by softlayer-ruby coveralls
1 parent fa004a6 commit a6869a6

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lib/softlayer/Config.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def Config.environment_settings
9090
result = {}
9191

9292
result[:api_key] = ENV['SL_API_KEY'] if ENV['SL_API_KEY']
93-
result[:user_agent] = ENV['SL_API_USER_AGENT'] || "softlayer-ruby #{VERSION}"
93+
result[:user_agent] = ENV['SL_API_USER_AGENT'] || "softlayer_api gem/#{SoftLayer::VERSION} (Ruby #{RUBY_PLATFORM}/#{RUBY_VERSION})"
9494
result[:username] = ENV['SL_USERNAME'] if ENV['SL_USERNAME']
9595

9696
if ENV['SL_API_BASE_URL'] && ENDPOINT_URL_ALIAS.include?(ENV['SL_API_BASE_URL'])
@@ -125,7 +125,7 @@ def Config.file_settings(*additional_files)
125125

126126
if softlayer_section
127127
result[:api_key] = softlayer_section['api_key'] if softlayer_section['api_key']
128-
result[:user_agent] = softlayer_section['user_agent'] || "softlayer-ruby #{VERSION}"
128+
result[:user_agent] = softlayer_section['user_agent'] || "softlayer_api gem/#{SoftLayer::VERSION} (Ruby #{RUBY_PLATFORM}/#{RUBY_VERSION})"
129129
result[:username] = softlayer_section['username'] if softlayer_section['username']
130130

131131
if softlayer_section['base_url'] && ENDPOINT_URL_ALIAS.include?(softlayer_section['base_url'])
@@ -153,7 +153,7 @@ def Config.globals_settings
153153
result = {}
154154

155155
result[:api_key] = $SL_API_KEY if $SL_API_KEY
156-
result[:user_agent] = $SL_API_USER_AGENT || "softlayer-ruby #{VERSION}"
156+
result[:user_agent] = $SL_API_USER_AGENT || "softlayer_api gem/#{SoftLayer::VERSION} (Ruby #{RUBY_PLATFORM}/#{RUBY_VERSION})"
157157
result[:username] = $SL_API_USERNAME if $SL_API_USERNAME
158158

159159
if $SL_API_ENDPOINT_URL && ENDPOINT_URL_ALIAS.include?($SL_API_ENDPOINT_URL)

0 commit comments

Comments
 (0)