mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[core] add credentials setter
This commit is contained in:
parent
455707b194
commit
e3d6fd723c
2 changed files with 7 additions and 2 deletions
|
@ -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|
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue