Merge "refactor: don't calculate list of attached lbs for every lb"
This commit is contained in:
commit
3f6f12015f
@ -989,10 +989,12 @@ class OVNClient(object):
|
||||
).execute(check_error=True)
|
||||
all_lswitches = self._nb_idl.db_find_rows(
|
||||
'Logical_Switch').execute(check_error=True)
|
||||
attached_lbs = set(
|
||||
lb for item in all_lswitches for lb in item.load_balancer)
|
||||
|
||||
commands = []
|
||||
for lb in lbs:
|
||||
if not any(lb in item.load_balancer for item in all_lswitches):
|
||||
if lb not in attached_lbs:
|
||||
# LB is not linked anywhere.
|
||||
continue
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user