From 58c6ad6c9ec171c0714fec240c79f5d140ec27fe Mon Sep 17 00:00:00 2001 From: James Higgins Date: Tue, 30 Aug 2016 10:42:14 -0400 Subject: [PATCH] Just use netloc to identify bucket name for s3 locations (#2713) --- packaging/language/maven_artifact.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packaging/language/maven_artifact.py b/packaging/language/maven_artifact.py index f5a88c7b220..1136f7aaaff 100644 --- a/packaging/language/maven_artifact.py +++ b/packaging/language/maven_artifact.py @@ -235,7 +235,7 @@ class MavenDownloader: parsed_url = urlparse(url) if parsed_url.scheme=='s3': parsed_url = urlparse(url) - bucket_name = parsed_url.netloc[:parsed_url.netloc.find('.')] + bucket_name = parsed_url.netloc key_name = parsed_url.path[1:] client = boto3.client('s3',aws_access_key_id=self.module.params.get('username', ''), aws_secret_access_key=self.module.params.get('password', '')) url_to_use = client.generate_presigned_url('get_object',Params={'Bucket':bucket_name,'Key':key_name},ExpiresIn=10) @@ -387,4 +387,4 @@ def main(): if __name__ == '__main__': - main() \ No newline at end of file + main()