Read only provider side of database relation
Since upgrade of mysql relation (and secrets), only the application's leader can lead the whole relation databag. Non-leader requiring units are only allowed to read the provider side of the relation and their own unit's. Change-Id: Iee073d654cabfbdefc817ea7c0207f3f28c457ac
This commit is contained in:
parent
35b4e10e30
commit
7285775f54
@ -332,10 +332,11 @@ class DBHandler(RelationHandler):
|
|||||||
|
|
||||||
def get_relation_data(self) -> dict:
|
def get_relation_data(self) -> dict:
|
||||||
"""Load the data from the relation for consumption in the handler."""
|
"""Load the data from the relation for consumption in the handler."""
|
||||||
if len(self.interface.relations) > 0:
|
# there is at most one relation for a database
|
||||||
return self.interface.relations[0].data[
|
for relation in self.model.relations[self.relation_name]:
|
||||||
self.interface.relations[0].app
|
if relation.app is None:
|
||||||
]
|
continue
|
||||||
|
return relation.data[relation.app]
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
Loading…
x
Reference in New Issue
Block a user