Skip to content

Commit

Permalink
fix: export fallback out of get (#510)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gu1nness authored Oct 15, 2024
1 parent b1e75fd commit 6ee2ad3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/charms/mongodb/v1/mongodb_backups.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

# Increment this PATCH version before using `charmcraft publish-lib` or reset
# to 0 if you are raising the major API version
LIBPATCH = 5
LIBPATCH = 6

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -800,7 +800,7 @@ def get_backup_error_status(self, backup_id: str) -> str:
"""Get the error status for a provided backup."""
pbm_status = self.charm.run_pbm_command(["status", "--out=json"])
pbm_status = json.loads(pbm_status)
backups = pbm_status["backups"].get("snapshot", [])
backups = pbm_status["backups"].get("snapshot") or []
for backup in backups:
if backup_id == backup["name"]:
return backup.get("error", "")
Expand Down

0 comments on commit 6ee2ad3

Please sign in to comment.