From 953ed0aecc203b0097f3d9f2578f0b394e9bd874 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Fri, 24 Apr 2015 11:03:36 -0400 Subject: [PATCH] avoid exception when boto is not available --- lib/ansible/modules/cloud/amazon/s3.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/amazon/s3.py b/lib/ansible/modules/cloud/amazon/s3.py index fe8aeaf0611..54288ad8723 100644 --- a/lib/ansible/modules/cloud/amazon/s3.py +++ b/lib/ansible/modules/cloud/amazon/s3.py @@ -153,7 +153,9 @@ def bucket_check(module, s3, bucket): else: return False -def create_bucket(module, s3, bucket, location=Location.DEFAULT): +def create_bucket(module, s3, bucket, location=None): + if location is None: + location = Location.DEFAULT try: bucket = s3.create_bucket(bucket, location=location) except s3.provider.storage_response_error, e: