ЛР 4: S3-вложения и исследование согласованности — Майорова БВТ2301

This commit is contained in:
2026-10-27 13:17:07 +03:00
parent ec540a1a72
commit 96007f4c5a
71 changed files with 7246 additions and 41 deletions
+13
View File
@@ -0,0 +1,13 @@
"""Idempotent private bucket bootstrap, executed only with administrative S3 keys."""
from botocore.exceptions import ClientError
from objects import Objects
from postgres import setting
objects = Objects(setting)
try:
objects.client.create_bucket(Bucket=objects.bucket)
except ClientError as exc:
if exc.response['Error']['Code'] not in ('BucketAlreadyOwnedByYou', 'BucketAlreadyExists'):
raise RuntimeError('Bucket bootstrap failed') from None
objects.ready()
print('Private bucket ready; static authenticated identities loaded from local secret config.')