From 127f00bb54544006cd81fc1831c580c7a641f940 Mon Sep 17 00:00:00 2001 From: shayancanonical <99665202+shayancanonical@users.noreply.github.com> Date: Tue, 28 Nov 2023 12:38:35 -0500 Subject: [PATCH] Fix bug that resulted in wrong output displayed from list-backups action (#340) --- lib/charms/mysql/v0/s3_helpers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/charms/mysql/v0/s3_helpers.py b/lib/charms/mysql/v0/s3_helpers.py index 9190df6d3..228befa7d 100644 --- a/lib/charms/mysql/v0/s3_helpers.py +++ b/lib/charms/mysql/v0/s3_helpers.py @@ -31,7 +31,7 @@ # Increment this PATCH version before using `charmcraft publish-lib` or reset # to 0 if you are raising the major API version -LIBPATCH = 4 +LIBPATCH = 5 def upload_content_to_s3(content: str, content_path: str, s3_parameters: Dict) -> bool: @@ -131,7 +131,7 @@ def list_backups_in_s3_path(s3_parameters: Dict) -> List[Tuple[str, str]]: for content in page.get("Contents", []): key = content["Key"] - filename = key.lstrip(s3_path_directory).split("/")[0] + filename = key.removeprefix(s3_path_directory) if ".metadata" in filename: try: