diff --git a/app/helpers/aws_helper.py b/app/helpers/aws_helper.py index cfcf7f6..cccda41 100644 --- a/app/helpers/aws_helper.py +++ b/app/helpers/aws_helper.py @@ -31,10 +31,9 @@ def get_object(key: str, bucket: str) -> bytes: def get_object_tag(key: str, bucket: str, tag_key: str) -> Union[str, None]: tags = get_object_tags(key, bucket) - tag_index = 0 - while tag_index < len(tags): - tag = tags[tag_index] + for i, tag in enumerate(tags): + tag = tags[i] if tag['Key'] == tag_key: return tag else: diff --git a/app/main.py b/app/main.py index f0f3580..ff2cc6f 100644 --- a/app/main.py +++ b/app/main.py @@ -28,7 +28,6 @@ class ServiceListener(Consumer): # but depending on if we can add the tagset to the sqs message body # we either extract that and then delegate to the appropriate service # or get the action tag from the object through the aws helper function - # service = None key = aws_helper.get_key_from_message(body) bucket = aws_helper.get_bucket_from_message(body) action = aws_helper.get_object_tag(key, bucket, 'action')['Value']