diff --git a/lib/fog/core/credentials.rb b/lib/fog/core/credentials.rb index e62bc9a79..68a1602a4 100644 --- a/lib/fog/core/credentials.rb +++ b/lib/fog/core/credentials.rb @@ -45,6 +45,11 @@ module Fog end end + # @return [Hash] The newly assigned credentials + def self.credentials=(new_credentials) + @credentials = new_credentials + end + def self.symbolize_credentials(args) if args.is_a? Hash Hash[ *args.collect do |key, value| diff --git a/tests/helpers/mock_helper.rb b/tests/helpers/mock_helper.rb index 260fe47c1..000ff0e71 100644 --- a/tests/helpers/mock_helper.rb +++ b/tests/helpers/mock_helper.rb @@ -8,7 +8,7 @@ end # if in mocked mode, fill in some fake credentials for us if Fog.mock? - Fog.instance_variable_set(:@credentials, { + Fog.credentials = { :aws_access_key_id => 'aws_access_key_id', :aws_secret_access_key => 'aws_secret_access_key', :bluebox_api_key => 'bluebox_api_key', @@ -57,5 +57,5 @@ if Fog.mock? :vsphere_username => 'apiuser', :vsphere_password => 'apipassword', :vsphere_expected_pubkey_hash => 'abcdef1234567890' - }) + } end