From 0b6ced2e048d4538db68abe356b8a4719a830fa0 Mon Sep 17 00:00:00 2001 From: Jeppe Toustrup Date: Thu, 14 May 2015 09:11:10 +0200 Subject: [PATCH] Check the needed env vars are provided to the backfill script --- backfill.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backfill.py b/backfill.py index b24adab..5546521 100755 --- a/backfill.py +++ b/backfill.py @@ -6,6 +6,12 @@ import boto3 +if not all([environ.get('AWS_S3_BUCKET'), environ.get('AWS_SQS_URL')]): + print('You have to specify the AWS_S3_BUCKET and AWS_SQS_URL environment variables.') + print('Check the "Backfilling data" section of the README file for more info.') + exit(1) + + bucket = boto3.resource('s3').Bucket(environ.get('AWS_S3_BUCKET')) queue = boto3.resource('sqs').Queue(environ.get('AWS_SQS_URL'))