From e16e77249fbe624ed3700ac4a10f54e9841cdade Mon Sep 17 00:00:00 2001
From: Matthew Barrington <edeninflames@gmail.com>
Date: Fri, 11 Oct 2013 16:01:54 +0100
Subject: [PATCH] Fixed crash when s3 bucket did not exist for put operation

---
 cloud/s3 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/cloud/s3 b/cloud/s3
index ae74424a574..75887eb9b6d 100644
--- a/cloud/s3
+++ b/cloud/s3
@@ -371,7 +371,8 @@ def main():
         
         # Lets check to see if bucket exists to get ground truth.
         bucketrtn = bucket_check(module, s3, bucket)
-        keyrtn = key_check(module, s3, bucket, obj)
+        if bucketrtn is True:
+            keyrtn = key_check(module, s3, bucket, obj)
 
         # Lets check key state. Does it exist and if it does, compute the etag md5sum.
         if bucketrtn is True and keyrtn is True: