avoid exception when boto is not available

This commit is contained in:
Brian Coca 2015-04-24 11:03:36 -04:00 committed by Matt Clay
parent 5e892b894b
commit 953ed0aecc

View file

@ -153,7 +153,9 @@ def bucket_check(module, s3, bucket):
else: else:
return False 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: try:
bucket = s3.create_bucket(bucket, location=location) bucket = s3.create_bucket(bucket, location=location)
except s3.provider.storage_response_error, e: except s3.provider.storage_response_error, e: