Cope with multiple cms relations

This commit is contained in:
Liam Young 2022-02-03 17:54:56 +00:00
parent 0b2e540e14
commit 9575a11be0

View File

@ -196,7 +196,8 @@ class OVSDBCMSProvides(Object):
def set_unit_data(self, settings: typing.Dict[str, str]) -> None:
"""Publish settings on the peer unit data bag."""
relation = self.framework.model.get_relation(self.relation_name)
for k, v in settings.items():
relation.data[self.model.unit][k] = v
relations = self.framework.model.relations[self.relation_name]
for relation in relations:
for k, v in settings.items():
relation.data[self.model.unit][k] = v