canonical / mongodb-operator

Charmed solution for MongoDB
Apache License 2.0
12 stars 14 forks source link

fix: export fallback out of get #510

Closed Gu1nness closed 1 month ago

Gu1nness commented 1 month ago

Issue

The dictionary can have a None value in case there's no snapshot: pbm status can contain a null value for pbm[backups][snapshot] which is parsed as None and then pbm_status["backups"].get("snapshot", []) == None which is not what is expected here since we want to iterate on the results

Solution

Export the fallback out of the get in order to ensure that we can iterate on it later.