export: Add check_metadata flag.

This commit is contained in:
Steve Howell 2021-12-06 22:08:06 +00:00 committed by Tim Abbott
parent 0166f13d83
commit 42ecabe967
1 changed files with 22 additions and 16 deletions

View File

@ -1455,6 +1455,12 @@ def export_files_from_s3(
key = bucket.Object(bkey.key)
"""
For very old realms we may not have proper metadata. If you really need
an export to bypass these checks, flip the following flag.
"""
checking_metadata = True
if checking_metadata:
if "realm_id" not in key.metadata:
raise AssertionError(f"Missing realm_id in key metadata: {key.metadata}")