Skip to content

Commit

Permalink
use aws id and secret from settings.py
Browse files Browse the repository at this point in the history
  • Loading branch information
srobertson committed Oct 31, 2012
1 parent cf36eb2 commit 85d9e17
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/disco/comm.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def _upload(url):
return [_upload(s3_url) for s3_url in s3_urls] + list(comm_pycurl.upload(non_s3_urls, source, token, **kwargs))

def s3_put(bucket, key, source):
conn = S3Connection()
conn = S3Connection(settings['AWS_ACCESS_KEY_ID'], settings['AWS_SECRET_KEY'])
bucket = conn.create_bucket(bucket)
k = Key(bucket)

Expand Down
5 changes: 4 additions & 1 deletion lib/disco/schemes/scheme_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
from boto.s3.key import Key

def open(url):
from disco.settings import DiscoSettings
settings = DiscoSettings()

key = os.path.basename(url)
(bucket, dirname) = os.path.split(os.path.dirname(url)[5:])
conn = S3Connection()
conn = S3Connection(settings['AWS_ACCESS_KEY_ID'], settings['AWS_SECRET_KEY'])
bucket = conn.create_bucket(bucket)
k = Key(bucket)
k.key = os.path.join(dirname, key)
Expand Down

0 comments on commit 85d9e17

Please sign in to comment.