Skip to content

Commit

Permalink
fix region url for us-east-1
Browse files Browse the repository at this point in the history
  • Loading branch information
zbintliff committed Aug 18, 2016
1 parent a55f23e commit 05d9bc5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bin/rpm-s3
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,16 @@ class FileGrabber(object):


def getclient(base, region):
host_url = "s3.amazonaws.com" if region == "us-east-1" else "s3-{}.amazonaws.com".format(region)
if os.getenv('AWS_ACCESS_KEY'):
return boto.connect_s3(
os.getenv('AWS_ACCESS_KEY'),
os.getenv('AWS_SECRET_KEY'),
host="s3-{}.amazonaws.com".format(region)
host=host_url
).get_bucket(base.netloc)
else:
return boto.connect_s3(
host="s3-{}.amazonaws.com".format(region)
host=host_url
).get_bucket(base.netloc)


Expand Down

0 comments on commit 05d9bc5

Please sign in to comment.