-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1b73bc3
commit c73786e
Showing
4 changed files
with
36 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import logging | ||
logging.basicConfig(level=logging.INFO) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import logging | ||
from transferrer.common import should_download_file, shoot_number_to_folder_path, get_source_bucket | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
def check_shoot_restore_status(bucket, shoot_number): | ||
check_folder_restore_status(bucket, shoot_number_to_folder_path(shoot_number)) | ||
|
||
|
||
def check_folder_restore_status(bucket, s3_folder: str): | ||
print(s3_folder) | ||
for obj in bucket.objects.filter(Prefix=s3_folder, OptionalObjectAttributes=[ | ||
'RestoreStatus', | ||
]): | ||
if should_download_file(obj.key): | ||
status = obj.restore_status | ||
else: | ||
status = "ignored" | ||
logger.info(f"{obj.key}\t{status}") | ||
|
||
|
||
if __name__ == "__main__": | ||
import sys | ||
shoot_number = sys.argv[1] | ||
check_shoot_restore_status(get_source_bucket(), sys.argv[1]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.