avoid exception when boto is not available

This commit is contained in:
Brian Coca 2015-04-24 11:03:36 -04:00
parent 178d3ea133
commit 0e23dd6c55

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: