Skip to content

Commit

Permalink
new format for rakefile (preparing to support having multiple configu…
Browse files Browse the repository at this point in the history
…red accounts)
  • Loading branch information
Wesley Beary committed Nov 22, 2009
1 parent 0f77090 commit cc1e573
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
18 changes: 12 additions & 6 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,18 @@ namespace :fog do
desc 'Provide a sample yaml file for credentials'
task :yml do
puts('Copy the following sample to ~/.fog and fill in with your credentials as needed:')
print("\n")
print(":aws_access_key_id: INTENTIONALLY_LEFT_BLANK\n")
print(":aws_secret_access_key: INTENTIONALLY_LEFT_BLANK\n")
print(":rackspace_api_key: INTENTIONALLY_LEFT_BLANK\n")
print(":rackspace_username: INTENTIONALLY_LEFT_BLANK\n")
print("\n")
yml = <<YML
:default:
:aws:
:aws_access_key_id: INTENTIONALLY_LEFT_BLANK
:aws_secret_access_key: INTENTIONALLY_LEFT_BLANK
:rackspace:
:rackspace_api_key: INTENTIONALLY_LEFT_BLANK
:rackspace_username: INTENTIONALLY_LEFT_BLANK
YML
print(yml)
end

end
2 changes: 1 addition & 1 deletion lib/fog.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def self.credentials(path = File.expand_path('~/.fog'))
@credentials ||= begin
credentials = {}
File.open(path) do |file|
credentials = YAML.load(file.read)
credentials = YAML.load(file.read)[:default]
end
credentials
end
Expand Down

0 comments on commit cc1e573

Please sign in to comment.