Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LOG-7362 Updated message when the S3 bucket is not found. #138

Merged
merged 2 commits into from Oct 9, 2020

Conversation

@swi-michalkrupa
Copy link
Contributor

@swi-michalkrupa swi-michalkrupa commented Oct 9, 2020

SQS3script.py updated

A purpose of this update is that when the script does not find the S3 bucket, it might be caused by the fact the SQS queue and the S3 bucket are in different regions, which is not supported by AWS. This is displayed to the user who runs the script, when the bucket is not found.

Next step is to update documentation.

@swi-michalkrupa swi-michalkrupa changed the title Updated message when the S3 bucket is not found. LOG-7362 Updated message when the S3 bucket is not found. Oct 9, 2020
@@ -287,7 +287,8 @@ def get_args():
def get_bucket(session, bucket_name):
bucket = session.resource('s3').Bucket(bucket_name)
if bucket.creation_date is None:
print('S3 bucket {} does not exist, please create it and run the script again'.format(bucket_name))
region = boto3.session.Session().region_name
print('\033[91m', 'S3 bucket {} does not exist, please create it and run the script again. Also, make sure the S3 bucket and the SQS queue are in the same region. Current session region: {}'.format(bucket_name, region))

This comment has been minimized.

@MichalChomo

MichalChomo Oct 9, 2020
Contributor

Could you create a custom print function which adds the color code and swap all prints for that one?

This comment has been minimized.

@swi-michalkrupa

swi-michalkrupa Oct 9, 2020
Author Contributor

Better?

@swi-michalkrupa swi-michalkrupa merged commit 5210433 into master Oct 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.