Fix Octavia no 'loadbalancer' AttributeError

This patch fixes Octavia AttributeError has no attribute 'loadbalancer'
on test_faults.

Change-Id: I367c8117f6d042693704f700676620cb345b2ea4
changes/08/816508/2
Omer 1 year ago committed by Omer Schwartz
parent 7af23e5159
commit eb9fb0a05a
  1. 14
      tobiko/openstack/stacks/_octavia.py
  2. 7
      tobiko/tests/faults/octavia/test_faults.py

@ -105,19 +105,21 @@ class OctaviaLoadbalancerStackFixture(heat.HeatStackFixture):
else:
return self.vip_network.ipv6_subnet_id
def wait_for_active_loadbalancer(self, **kwargs):
def wait_for_active_loadbalancer(self):
loadbalancer_id = self.stack.output_show(
'loadbalancer_id')['output']['output_value']
octavia.wait_for_status(status_key=octavia.PROVISIONING_STATUS,
status=octavia.ACTIVE,
get_client=octavia.get_loadbalancer,
object_id=self.loadbalancer.loadbalancer_id,
**kwargs)
object_id=loadbalancer_id)
def wait_for_update_loadbalancer(self, **kwargs):
def wait_for_update_loadbalancer(self):
loadbalancer_id = self.stack.output_show(
'loadbalancer_id')['output']['output_value']
octavia.wait_for_status(status_key=octavia.PROVISIONING_STATUS,
status=octavia.PENDING_UPDATE,
get_client=octavia.get_loadbalancer,
object_id=self.loadbalancer.loadbalancer_id,
**kwargs)
object_id=loadbalancer_id)
class OctaviaListenerStackFixture(heat.HeatStackFixture):

@ -90,9 +90,7 @@ class OctaviaBasicFaultTest(testtools.TestCase):
# Wait for the LB to be updated
try:
self.loadbalancer_stack.wait_for_update_loadbalancer(
loadbalancer_id=self.loadbalancer_stack.loadbalancer_id,
timeout=30)
self.loadbalancer_stack.wait_for_update_loadbalancer(timeout=30)
except tobiko.RetryTimeLimitError:
LOG.info('The restarted servers reached ACTIVE status after the'
@ -100,8 +98,7 @@ class OctaviaBasicFaultTest(testtools.TestCase):
' being raised even though the update timeout was'
' reached.')
self.loadbalancer_stack.wait_for_active_loadbalancer(
loadbalancer_id=self.loadbalancer_stack.loadbalancer_id)
self.loadbalancer_stack.wait_for_active_loadbalancer()
LOG.debug(f'Load Balancer {self.loadbalancer_stack.loadbalancer_id} is'
f' ACTIVE')

Loading…
Cancel
Save