auth: perserve original option param
authorJohan Euphrosine <proppy@google.com>
Thu, 15 Aug 2013 21:19:37 +0000 (14:19 -0700)
committerJohan Euphrosine <proppy@google.com>
Thu, 15 Aug 2013 21:19:37 +0000 (14:19 -0700)
lib/google/api_client/auth/compute_service_account.rb

index 085d81bbaf19c562ab6da8e42cb776f819962e5a..3f512f9a0395c688f68cab479df053a498311d25 100644 (file)
@@ -19,8 +19,8 @@ module Google
   class APIClient
     class ComputeServiceAccount < Signet::OAuth2::Client
       def fetch_access_token(options={})
-        options[:connection] ||= Faraday.default_connection
-        response = options[:connection].get 'http://metadata/computeMetadata/v1beta1/instance/service-accounts/default/token'
+        connection = options[:connection] || Faraday.default_connection
+        response = connection.get 'http://metadata/computeMetadata/v1beta1/instance/service-accounts/default/token'
         Signet::OAuth2.parse_json_credentials(response.body)
       end
     end