[#334] Automation of PATCH method in S3

Signed-off-by: Kirill Sosnovskikh <k.sosnovskikh@yadro.com>
This commit is contained in:
Kirill Sosnovskikh 2024-11-15 21:03:21 +03:00
parent 8ff1e72499
commit cd15be3b7c
6 changed files with 162 additions and 13 deletions

View file

@ -171,7 +171,7 @@ class AwsCliClient(S3ClientWrapper):
return response.get("TagSet")
@reporter.step("Get bucket acl")
def get_bucket_acl(self, bucket: str) -> list:
def get_bucket_acl(self, bucket: str) -> dict:
if bucket.startswith("-") or " " in bucket:
bucket = f'"{bucket}"'
@ -179,8 +179,7 @@ class AwsCliClient(S3ClientWrapper):
f"aws {self.common_flags} s3api get-bucket-acl --bucket {bucket} " f"--endpoint {self.s3gate_endpoint} --profile {self.profile}"
)
output = self.local_shell.exec(cmd).stdout
response = self._to_json(output)
return response.get("Grants")
return self._to_json(output)
@reporter.step("Get bucket location")
def get_bucket_location(self, bucket: str) -> dict:
@ -861,7 +860,7 @@ class AwsCliClient(S3ClientWrapper):
return response["Parts"]
@reporter.step("Complete multipart upload S3")
def complete_multipart_upload(self, bucket: str, key: str, upload_id: str, parts: list) -> None:
def complete_multipart_upload(self, bucket: str, key: str, upload_id: str, parts: list) -> dict:
if bucket.startswith("-") or " " in bucket:
bucket = f'"{bucket}"'