Avoid memoizing network-related false negatives of GCECredentials.on_gce? (#137)

This commit is contained in:
Kazuhiro Serizawa authored and Daniel Azuma committed 2018-06-05 15:20:36 -07:00
1 parent 9232aa3176
commit edaa784d3d
1 file changed
+5 -1
+5 -1
View File
@@ -58,7 +58,11 @@ ERROR_MESSAGE
DefaultCredentials.from_well_known_path(scope) ||
DefaultCredentials.from_system_default_path(scope)
return creds unless creds.nil?
raise NOT_FOUND_ERROR unless GCECredentials.on_gce?(options)
unless GCECredentials.on_gce?(options)
# Clear cache of the result of GCECredentials.on_gce?
GCECredentials.unmemoize_all
raise NOT_FOUND_ERROR
end
GCECredentials.new
end