Check relation exists in ovsdb lib
This commit is contained in:
parent
b7e26988ff
commit
45cf162c8a
@ -37,7 +37,7 @@ LIBAPI = 0
|
|||||||
|
|
||||||
# Increment this PATCH version before using `charmcraft publish-lib` or reset
|
# Increment this PATCH version before using `charmcraft publish-lib` or reset
|
||||||
# to 0 if you are raising the major API version
|
# to 0 if you are raising the major API version
|
||||||
LIBPATCH = 1
|
LIBPATCH = 2
|
||||||
|
|
||||||
|
|
||||||
# TODO: add your code here! Happy coding!
|
# TODO: add your code here! Happy coding!
|
||||||
@ -122,8 +122,9 @@ class OVSDBCMSRequires(Object):
|
|||||||
"""Retrieve value for key from all related units."""
|
"""Retrieve value for key from all related units."""
|
||||||
values = []
|
values = []
|
||||||
relation = self.framework.model.get_relation(self.relation_name)
|
relation = self.framework.model.get_relation(self.relation_name)
|
||||||
for unit in relation.units:
|
if relation:
|
||||||
values.append(relation.data[unit].get(key))
|
for unit in relation.units:
|
||||||
|
values.append(relation.data[unit].get(key))
|
||||||
return values
|
return values
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user