Skip to content

Commit

Permalink
Merge pull request bluesentry#13 from upsidetravel/fix-12
Browse files Browse the repository at this point in the history
Removes all AV_STATUS tags from object before saving new ones
  • Loading branch information
jaygorrell authored Nov 22, 2017
2 parents 3d8fdd1 + 40a1421 commit 734ab1d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,8 @@ def set_av_tags(s3_object, result):
curr_tags = s3_client.get_object_tagging(Bucket=s3_object.bucket_name, Key=s3_object.key)["TagSet"]
new_tags = copy.copy(curr_tags)
for tag in curr_tags:
if tag["Key"] == AV_STATUS_METADATA:
if tag["Key"] in [AV_STATUS_METADATA, AV_TIMESTAMP_METADATA]:
new_tags.remove(tag)
break
new_tags.append({"Key": AV_STATUS_METADATA, "Value": result})
new_tags.append({"Key": AV_TIMESTAMP_METADATA, "Value": datetime.utcnow().strftime("%Y/%m/%d %H:%M:%S UTC")})
s3_client.put_object_tagging(
Expand Down

0 comments on commit 734ab1d

Please sign in to comment.