Skip to content

Commit

Permalink
Defer on non-existent peer databag
Browse files Browse the repository at this point in the history
  • Loading branch information
dragomirp committed Aug 7, 2023
1 parent ba5cbf6 commit 385f642
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/relations/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,11 @@ def _on_relation_joined(self, join_event: RelationJoinedEvent):
f"DEPRECATION WARNING - {self.relation_name} is a legacy relation, and will be deprecated in a future release. "
)

remote_app_databag = join_event.relation.data[join_event.app]
remote_app_databag = join_event.relation.data.get(join_event.app)
if remote_app_databag is None:
logger.warning("Defer relation joined: No remote app databag")
join_event.defer()
return

if self._block_on_extensions(join_event.relation, remote_app_databag):
return
Expand Down

0 comments on commit 385f642

Please sign in to comment.