Skip to content

Commit

Permalink
Fixing find_or_create_bucket
Browse files Browse the repository at this point in the history
it needs to return the bucket after it creates it
  • Loading branch information
Jacques Crocker committed Oct 26, 2010
1 parent 73b9bb9 commit c0693a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/jammit/s3_uploader.rb
Expand Up @@ -71,16 +71,16 @@ def find_or_create_bucket
s3_service = S3::Service.new(:access_key_id => @access_key_id, :secret_access_key => @secret_access_key)

# find or create the bucket
bucket = begin
begin
s3_service.buckets.find(@bucket_name)
rescue S3::Error::NoSuchBucket
log "Bucket not found. Creating '#{@bucket_name}'..."
bucket = s3_service.buckets.build(@bucket_name)

location = (@bucket_location.to_s.strip.downcase == "eu") ? :eu : :us
bucket.save(location)
bucket
end
bucket
end

def log(msg)
Expand Down

0 comments on commit c0693a9

Please sign in to comment.