From 6bca93fc461f5db6d212adf2a09391fa1729e4f1 Mon Sep 17 00:00:00 2001 From: ibarria0 Date: Thu, 31 Mar 2016 16:21:43 -0500 Subject: [PATCH 1/2] get bucket only gets the required bucket --- cactus/deployment/s3/engine.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cactus/deployment/s3/engine.py b/cactus/deployment/s3/engine.py index 3381eade..13081d5c 100644 --- a/cactus/deployment/s3/engine.py +++ b/cactus/deployment/s3/engine.py @@ -65,9 +65,8 @@ def get_bucket(self): :returns: The Bucket if found, None otherwise. :raises: InvalidCredentials if we can't connect to AWS """ - buckets = self._get_buckets() - buckets = dict((bucket.name, bucket) for bucket in buckets) - return buckets.get(self.bucket_name) + s3 = self.get_connection() + return s3.get_bucket(self.bucket_name) def create_bucket(self): """ From b178bf9eeab9c2266e6d79a6a549bf97bd3e1ded Mon Sep 17 00:00:00 2001 From: ibarria0 Date: Thu, 31 Mar 2016 16:26:04 -0500 Subject: [PATCH 2/2] changed var name to avoid conflict --- cactus/deployment/s3/engine.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cactus/deployment/s3/engine.py b/cactus/deployment/s3/engine.py index 13081d5c..bd779c12 100644 --- a/cactus/deployment/s3/engine.py +++ b/cactus/deployment/s3/engine.py @@ -65,8 +65,8 @@ def get_bucket(self): :returns: The Bucket if found, None otherwise. :raises: InvalidCredentials if we can't connect to AWS """ - s3 = self.get_connection() - return s3.get_bucket(self.bucket_name) + s3con = self.get_connection() + return s3con.get_bucket(self.bucket_name) def create_bucket(self): """