ovsdb-cluster: Fix function errenously treated as property

Simplify search loop for ``bound-address``.

Rename interface code directories so they can be imported by
unit tests.
This commit is contained in:
Frode Nordahl 2019-10-11 10:45:11 +02:00
parent feefb50616
commit f199ccefb4
No known key found for this signature in database
GPG Key ID: 6A5D59A3BA48373F
9 changed files with 5 additions and 8 deletions

View File

@ -44,19 +44,16 @@ class OVSDBClusterPeer(ovsdb.OVSDB):
for relation in self.relations:
for unit in relation.units:
if not unit.received.get('bound-address'):
break
else:
continue
break
else:
return True
return False
return True
return False
@when('endpoint.{endpoint_name}.joined')
def joined(self):
super().joined()
self.publish_cluster_local_addr()
if self.expected_peers_available:
if reactive.is_flag_set('leadership.set.ready'):
self.publish_cluster_local_addr()
if self.expected_peers_available():
reactive.set_flag(self.expand_name('{endpoint_name}.available'))
@when('endpoint.{endpoint_name}.broken')