Skip to content

Commit

Permalink
Rerert changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-ratushnyy committed Oct 12, 2023
1 parent d810a00 commit b617128
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/charms/data_platform_libs/v0/data_interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -1643,7 +1643,11 @@ def _assign_relation_alias(self, relation_id: int) -> None:
logger.debug("Alias %s was already assigned to relation %d", alias, relation.id)
available_aliases.remove(alias)

# Set the alias in app relation databag of the specific relation.
# Set the alias in the unit relation databag of the specific relation.
relation = self.charm.model.get_relation(self.relation_name, relation_id)
relation.data[self.local_unit].update({"alias": available_aliases[0]})

# Set the alias in the app relation databag of the specific relation.
self.update_relation_data(relation_id, {"alias": available_aliases[0]})

def _emit_aliased_event(self, event: RelationChangedEvent, event_name: str) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1643,6 +1643,10 @@ def _assign_relation_alias(self, relation_id: int) -> None:
logger.debug("Alias %s was already assigned to relation %d", alias, relation.id)
available_aliases.remove(alias)

# Set the alias in the unit relation databag of the specific relation.
relation = self.charm.model.get_relation(self.relation_name, relation_id)
relation.data[self.local_unit].update({"alias": available_aliases[0]})

# Set the alias in the app relation databag of the specific relation.
self.update_relation_data(relation_id, {"alias": available_aliases[0]})

Expand Down

0 comments on commit b617128

Please sign in to comment.