forked from mtusi2026/mtusi2026lab6
ЛР6: наблюдаемость, сквозные traces и исследование sampling
This commit is contained in:
@@ -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.')
|
||||
Reference in New Issue
Block a user