Last active
January 1, 2020 22:48
-
-
Save davidmukiibi/9e3f2af05bb3b2a16155edb0303284e2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create_bucket(self, bucket_name, region=None): | |
speak_output = "" | |
try: | |
s3_client.create_bucket(Bucket=bucket_name) | |
except ClientError as e: | |
logging.error(e) | |
if e.response['Error']['Code'] == "BucketAlreadyExists": | |
speak_output = "The requested bucket name is either not available, already \ | |
exists or not unique to AWS, please select a different name and try again." | |
return False | |
return True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment