mirror of
https://github.com/fog/fog-aws.git
synced 2022-11-09 13:50:52 -05:00
do not make requests if mocked.
This commit is contained in:
parent
5e6f7fd085
commit
1e129089ab
1 changed files with 4 additions and 0 deletions
|
@ -5,6 +5,10 @@ module Fog
|
|||
INSTANCE_METADATA_PATH = "/latest/meta-data/iam/security-credentials/"
|
||||
module ServiceMethods
|
||||
def fetch_credentials(options)
|
||||
if options[:use_iam_profile] && Fog.mocking?
|
||||
mock_iam = {:use_iam_profile => true, :aws_access_key_id => "mock-iam-role", :aws_secret_access_key => "mock-iam-role"}
|
||||
return options.merge(mock_iam)
|
||||
end
|
||||
if options[:use_iam_profile]
|
||||
begin
|
||||
connection = options[:connection] || Excon.new(INSTANCE_METADATA_HOST)
|
||||
|
|
Loading…
Reference in a new issue