Merge "Fix LB set in ERROR too early in the revert flow"
This commit is contained in:
commit
9cda3a9e46
@ -254,7 +254,6 @@ class AmphoraPostVIPPlug(BaseAmphoraTask):
|
|||||||
return
|
return
|
||||||
LOG.warning("Reverting post vip plug.")
|
LOG.warning("Reverting post vip plug.")
|
||||||
self.task_utils.mark_amphora_status_error(amphora.id)
|
self.task_utils.mark_amphora_status_error(amphora.id)
|
||||||
self.task_utils.mark_loadbalancer_prov_status_error(loadbalancer.id)
|
|
||||||
|
|
||||||
|
|
||||||
class AmphoraePostVIPPlug(BaseAmphoraTask):
|
class AmphoraePostVIPPlug(BaseAmphoraTask):
|
||||||
@ -268,13 +267,6 @@ class AmphoraePostVIPPlug(BaseAmphoraTask):
|
|||||||
loadbalancer,
|
loadbalancer,
|
||||||
amphorae_network_config)
|
amphorae_network_config)
|
||||||
|
|
||||||
def revert(self, result, loadbalancer, *args, **kwargs):
|
|
||||||
"""Handle a failed amphora vip plug notification."""
|
|
||||||
if isinstance(result, failure.Failure):
|
|
||||||
return
|
|
||||||
LOG.warning("Reverting amphorae post vip plug.")
|
|
||||||
self.task_utils.mark_loadbalancer_prov_status_error(loadbalancer.id)
|
|
||||||
|
|
||||||
|
|
||||||
class AmphoraCertUpload(BaseAmphoraTask):
|
class AmphoraCertUpload(BaseAmphoraTask):
|
||||||
"""Upload a certificate to the amphora."""
|
"""Upload a certificate to the amphora."""
|
||||||
|
@ -1009,10 +1009,6 @@ class MarkLBActiveInDB(BaseDatabaseTask):
|
|||||||
LOG.warning("Error updating listener %s provisioning "
|
LOG.warning("Error updating listener %s provisioning "
|
||||||
"status", listener.id)
|
"status", listener.id)
|
||||||
|
|
||||||
LOG.warning("Reverting mark load balancer deleted in DB "
|
|
||||||
"for load balancer id %s", loadbalancer.id)
|
|
||||||
self.task_utils.mark_loadbalancer_prov_status_error(loadbalancer.id)
|
|
||||||
|
|
||||||
|
|
||||||
class UpdateLBServerGroupInDB(BaseDatabaseTask):
|
class UpdateLBServerGroupInDB(BaseDatabaseTask):
|
||||||
"""Update the server group id info for load balancer in DB."""
|
"""Update the server group id info for load balancer in DB."""
|
||||||
@ -1072,17 +1068,6 @@ class MarkLBDeletedInDB(BaseDatabaseTask):
|
|||||||
loadbalancer.id,
|
loadbalancer.id,
|
||||||
provisioning_status=constants.DELETED)
|
provisioning_status=constants.DELETED)
|
||||||
|
|
||||||
def revert(self, loadbalancer, *args, **kwargs):
|
|
||||||
"""Mark the load balancer as broken and ready to be cleaned up.
|
|
||||||
|
|
||||||
:param loadbalancer: Load balancer object that failed to update
|
|
||||||
:returns: None
|
|
||||||
"""
|
|
||||||
|
|
||||||
LOG.warning("Reverting mark load balancer deleted in DB "
|
|
||||||
"for load balancer id %s", loadbalancer.id)
|
|
||||||
self.task_utils.mark_loadbalancer_prov_status_error(loadbalancer.id)
|
|
||||||
|
|
||||||
|
|
||||||
class MarkLBPendingDeleteInDB(BaseDatabaseTask):
|
class MarkLBPendingDeleteInDB(BaseDatabaseTask):
|
||||||
"""Mark the load balancer pending delete in the DB.
|
"""Mark the load balancer pending delete in the DB.
|
||||||
@ -1104,17 +1089,6 @@ class MarkLBPendingDeleteInDB(BaseDatabaseTask):
|
|||||||
provisioning_status=(constants.
|
provisioning_status=(constants.
|
||||||
PENDING_DELETE))
|
PENDING_DELETE))
|
||||||
|
|
||||||
def revert(self, loadbalancer, *args, **kwargs):
|
|
||||||
"""Mark the load balancer as broken and ready to be cleaned up.
|
|
||||||
|
|
||||||
:param loadbalancer: Load balancer object that failed to update
|
|
||||||
:returns: None
|
|
||||||
"""
|
|
||||||
|
|
||||||
LOG.warning("Reverting mark load balancer pending delete in DB "
|
|
||||||
"for load balancer id %s", loadbalancer.id)
|
|
||||||
self.task_utils.mark_loadbalancer_prov_status_error(loadbalancer.id)
|
|
||||||
|
|
||||||
|
|
||||||
class MarkLBAndListenersActiveInDB(BaseDatabaseTask):
|
class MarkLBAndListenersActiveInDB(BaseDatabaseTask):
|
||||||
"""Mark the load balancer and specified listeners active in the DB.
|
"""Mark the load balancer and specified listeners active in the DB.
|
||||||
@ -1148,12 +1122,10 @@ class MarkLBAndListenersActiveInDB(BaseDatabaseTask):
|
|||||||
:returns: None
|
:returns: None
|
||||||
"""
|
"""
|
||||||
|
|
||||||
LOG.warning("Reverting mark load balancer and listeners active in DB "
|
LOG.warning("Reverting mark listeners active in DB "
|
||||||
"for load balancer id %(LB)s and listener ids: %(list)s",
|
"for listener ids: %(list)s",
|
||||||
{'LB': loadbalancer.id,
|
{'list': ', '.join([listener.id
|
||||||
'list': ', '.join([listener.id
|
|
||||||
for listener in listeners])})
|
for listener in listeners])})
|
||||||
self.task_utils.mark_loadbalancer_prov_status_error(loadbalancer.id)
|
|
||||||
for listener in listeners:
|
for listener in listeners:
|
||||||
self.task_utils.mark_listener_prov_status_error(listener.id)
|
self.task_utils.mark_listener_prov_status_error(listener.id)
|
||||||
|
|
||||||
@ -1240,18 +1212,6 @@ class UpdateLoadbalancerInDB(BaseDatabaseTask):
|
|||||||
self.loadbalancer_repo.update(db_apis.get_session(), loadbalancer.id,
|
self.loadbalancer_repo.update(db_apis.get_session(), loadbalancer.id,
|
||||||
**update_dict)
|
**update_dict)
|
||||||
|
|
||||||
def revert(self, loadbalancer, *args, **kwargs):
|
|
||||||
"""Mark the loadbalancer ERROR since the update couldn't happen
|
|
||||||
|
|
||||||
:param loadbalancer: The load balancer that couldn't be updated
|
|
||||||
:returns: None
|
|
||||||
"""
|
|
||||||
|
|
||||||
LOG.warning("Reverting update loadbalancer in DB "
|
|
||||||
"for loadbalancer id %s", loadbalancer.id)
|
|
||||||
|
|
||||||
self.task_utils.mark_loadbalancer_prov_status_error(loadbalancer.id)
|
|
||||||
|
|
||||||
|
|
||||||
class UpdateHealthMonInDB(BaseDatabaseTask):
|
class UpdateHealthMonInDB(BaseDatabaseTask):
|
||||||
"""Update the health monitor in the DB.
|
"""Update the health monitor in the DB.
|
||||||
|
@ -433,6 +433,10 @@ class AmphoraFlows(object):
|
|||||||
failover_amp_flow = linear_flow.Flow(
|
failover_amp_flow = linear_flow.Flow(
|
||||||
constants.FAILOVER_AMPHORA_FLOW)
|
constants.FAILOVER_AMPHORA_FLOW)
|
||||||
|
|
||||||
|
# Revert LB to provisioning_status ERROR if this flow goes wrong
|
||||||
|
failover_amp_flow.add(lifecycle_tasks.LoadBalancerToErrorOnRevertTask(
|
||||||
|
requires=constants.LOADBALANCER))
|
||||||
|
|
||||||
# Revert amphora to status ERROR if this flow goes wrong
|
# Revert amphora to status ERROR if this flow goes wrong
|
||||||
failover_amp_flow.add(lifecycle_tasks.AmphoraToErrorOnRevertTask(
|
failover_amp_flow.add(lifecycle_tasks.AmphoraToErrorOnRevertTask(
|
||||||
requires=constants.AMPHORA,
|
requires=constants.AMPHORA,
|
||||||
|
@ -359,8 +359,6 @@ class AmphoraPostVIPPlug(BaseAmphoraTask):
|
|||||||
return
|
return
|
||||||
LOG.warning("Reverting post vip plug.")
|
LOG.warning("Reverting post vip plug.")
|
||||||
self.task_utils.mark_amphora_status_error(amphora.get(constants.ID))
|
self.task_utils.mark_amphora_status_error(amphora.get(constants.ID))
|
||||||
self.task_utils.mark_loadbalancer_prov_status_error(
|
|
||||||
loadbalancer[constants.LOADBALANCER_ID])
|
|
||||||
|
|
||||||
|
|
||||||
class AmphoraePostVIPPlug(BaseAmphoraTask):
|
class AmphoraePostVIPPlug(BaseAmphoraTask):
|
||||||
@ -376,14 +374,6 @@ class AmphoraePostVIPPlug(BaseAmphoraTask):
|
|||||||
loadbalancer,
|
loadbalancer,
|
||||||
amphorae_network_config)
|
amphorae_network_config)
|
||||||
|
|
||||||
def revert(self, result, loadbalancer, *args, **kwargs):
|
|
||||||
"""Handle a failed amphora vip plug notification."""
|
|
||||||
if isinstance(result, failure.Failure):
|
|
||||||
return
|
|
||||||
LOG.warning("Reverting amphorae post vip plug.")
|
|
||||||
self.task_utils.mark_loadbalancer_prov_status_error(
|
|
||||||
loadbalancer[constants.LOADBALANCER_ID])
|
|
||||||
|
|
||||||
|
|
||||||
class AmphoraCertUpload(BaseAmphoraTask):
|
class AmphoraCertUpload(BaseAmphoraTask):
|
||||||
"""Upload a certificate to the amphora."""
|
"""Upload a certificate to the amphora."""
|
||||||
|
@ -1086,12 +1086,6 @@ class MarkLBActiveInDB(BaseDatabaseTask):
|
|||||||
LOG.warning("Error updating listener %s provisioning "
|
LOG.warning("Error updating listener %s provisioning "
|
||||||
"status", listener.id)
|
"status", listener.id)
|
||||||
|
|
||||||
LOG.warning("Reverting mark load balancer deleted in DB "
|
|
||||||
"for load balancer id %s",
|
|
||||||
loadbalancer[constants.LOADBALANCER_ID])
|
|
||||||
self.task_utils.mark_loadbalancer_prov_status_error(
|
|
||||||
loadbalancer[constants.LOADBALANCER_ID])
|
|
||||||
|
|
||||||
|
|
||||||
class MarkLBActiveInDBByListener(BaseDatabaseTask):
|
class MarkLBActiveInDBByListener(BaseDatabaseTask):
|
||||||
"""Mark the load balancer active in the DB using a listener dict.
|
"""Mark the load balancer active in the DB using a listener dict.
|
||||||
@ -1112,22 +1106,6 @@ class MarkLBActiveInDBByListener(BaseDatabaseTask):
|
|||||||
listener[constants.LOADBALANCER_ID],
|
listener[constants.LOADBALANCER_ID],
|
||||||
provisioning_status=constants.ACTIVE)
|
provisioning_status=constants.ACTIVE)
|
||||||
|
|
||||||
def revert(self, listener, *args, **kwargs):
|
|
||||||
"""Mark the load balancer as broken and ready to be cleaned up.
|
|
||||||
|
|
||||||
This also puts all sub-objects of the load balancer to ERROR state if
|
|
||||||
self.mark_subobjects is True
|
|
||||||
|
|
||||||
:param listener: Listener dictionary
|
|
||||||
:returns: None
|
|
||||||
"""
|
|
||||||
|
|
||||||
LOG.warning("Reverting mark load balancer active in DB "
|
|
||||||
"for load balancer id %s",
|
|
||||||
listener[constants.LOADBALANCER_ID])
|
|
||||||
self.task_utils.mark_loadbalancer_prov_status_error(
|
|
||||||
listener[constants.LOADBALANCER_ID])
|
|
||||||
|
|
||||||
|
|
||||||
class UpdateLBServerGroupInDB(BaseDatabaseTask):
|
class UpdateLBServerGroupInDB(BaseDatabaseTask):
|
||||||
"""Update the server group id info for load balancer in DB."""
|
"""Update the server group id info for load balancer in DB."""
|
||||||
@ -1187,19 +1165,6 @@ class MarkLBDeletedInDB(BaseDatabaseTask):
|
|||||||
loadbalancer[constants.LOADBALANCER_ID],
|
loadbalancer[constants.LOADBALANCER_ID],
|
||||||
provisioning_status=constants.DELETED)
|
provisioning_status=constants.DELETED)
|
||||||
|
|
||||||
def revert(self, loadbalancer, *args, **kwargs):
|
|
||||||
"""Mark the load balancer as broken and ready to be cleaned up.
|
|
||||||
|
|
||||||
:param loadbalancer: Load balancer object that failed to update
|
|
||||||
:returns: None
|
|
||||||
"""
|
|
||||||
|
|
||||||
LOG.warning("Reverting mark load balancer deleted in DB "
|
|
||||||
"for load balancer id %s",
|
|
||||||
loadbalancer[constants.LOADBALANCER_ID])
|
|
||||||
self.task_utils.mark_loadbalancer_prov_status_error(
|
|
||||||
loadbalancer[constants.LOADBALANCER_ID])
|
|
||||||
|
|
||||||
|
|
||||||
class MarkLBPendingDeleteInDB(BaseDatabaseTask):
|
class MarkLBPendingDeleteInDB(BaseDatabaseTask):
|
||||||
"""Mark the load balancer pending delete in the DB.
|
"""Mark the load balancer pending delete in the DB.
|
||||||
@ -1221,19 +1186,6 @@ class MarkLBPendingDeleteInDB(BaseDatabaseTask):
|
|||||||
provisioning_status=(constants.
|
provisioning_status=(constants.
|
||||||
PENDING_DELETE))
|
PENDING_DELETE))
|
||||||
|
|
||||||
def revert(self, loadbalancer, *args, **kwargs):
|
|
||||||
"""Mark the load balancer as broken and ready to be cleaned up.
|
|
||||||
|
|
||||||
:param loadbalancer: Load balancer object that failed to update
|
|
||||||
:returns: None
|
|
||||||
"""
|
|
||||||
|
|
||||||
LOG.warning("Reverting mark load balancer pending delete in DB "
|
|
||||||
"for load balancer id %s",
|
|
||||||
loadbalancer[constants.LOADBALANCER_ID])
|
|
||||||
self.task_utils.mark_loadbalancer_prov_status_error(
|
|
||||||
loadbalancer[constants.LOADBALANCER_ID])
|
|
||||||
|
|
||||||
|
|
||||||
class MarkLBAndListenersActiveInDB(BaseDatabaseTask):
|
class MarkLBAndListenersActiveInDB(BaseDatabaseTask):
|
||||||
"""Mark the load balancer and specified listeners active in the DB.
|
"""Mark the load balancer and specified listeners active in the DB.
|
||||||
@ -1272,20 +1224,11 @@ class MarkLBAndListenersActiveInDB(BaseDatabaseTask):
|
|||||||
:param listeners: Listener objects that failed to update
|
:param listeners: Listener objects that failed to update
|
||||||
:returns: None
|
:returns: None
|
||||||
"""
|
"""
|
||||||
lb_id = None
|
lists = ', '.join([listener[constants.LISTENER_ID]
|
||||||
if loadbalancer_id:
|
for listener in listeners])
|
||||||
lb_id = loadbalancer_id
|
LOG.warning("Reverting mark listeners active in "
|
||||||
elif listeners:
|
"DB for listener ids: "
|
||||||
lb_id = listeners[0][constants.LOADBALANCER_ID]
|
"%(list)s", {'list': lists})
|
||||||
|
|
||||||
if lb_id:
|
|
||||||
lists = ', '.join([listener[constants.LISTENER_ID]
|
|
||||||
for listener in listeners])
|
|
||||||
LOG.warning("Reverting mark load balancer and listeners active in "
|
|
||||||
"DB for load balancer id %(LB)s and listener ids: "
|
|
||||||
"%(list)s", {'LB': lb_id,
|
|
||||||
'list': lists})
|
|
||||||
self.task_utils.mark_loadbalancer_prov_status_error(lb_id)
|
|
||||||
|
|
||||||
for listener in listeners:
|
for listener in listeners:
|
||||||
self.task_utils.mark_listener_prov_status_error(
|
self.task_utils.mark_listener_prov_status_error(
|
||||||
@ -1376,20 +1319,6 @@ class UpdateLoadbalancerInDB(BaseDatabaseTask):
|
|||||||
loadbalancer[constants.LOADBALANCER_ID],
|
loadbalancer[constants.LOADBALANCER_ID],
|
||||||
**update_dict)
|
**update_dict)
|
||||||
|
|
||||||
def revert(self, loadbalancer, *args, **kwargs):
|
|
||||||
"""Mark the loadbalancer ERROR since the update couldn't happen
|
|
||||||
|
|
||||||
:param loadbalancer: The load balancer that couldn't be updated
|
|
||||||
:returns: None
|
|
||||||
"""
|
|
||||||
|
|
||||||
LOG.warning("Reverting update loadbalancer in DB "
|
|
||||||
"for loadbalancer id %s",
|
|
||||||
loadbalancer[constants.LOADBALANCER_ID])
|
|
||||||
|
|
||||||
self.task_utils.mark_loadbalancer_prov_status_error(
|
|
||||||
loadbalancer[constants.LOADBALANCER_ID])
|
|
||||||
|
|
||||||
|
|
||||||
class UpdateHealthMonInDB(BaseDatabaseTask):
|
class UpdateHealthMonInDB(BaseDatabaseTask):
|
||||||
"""Update the health monitor in the DB.
|
"""Update the health monitor in the DB.
|
||||||
|
@ -496,10 +496,7 @@ class TestAmphoraDriverTasks(base.TestCase):
|
|||||||
_session_mock,
|
_session_mock,
|
||||||
id=AMP_ID,
|
id=AMP_ID,
|
||||||
status=constants.ERROR)
|
status=constants.ERROR)
|
||||||
repo.LoadBalancerRepository.update.assert_called_once_with(
|
repo.LoadBalancerRepository.update.assert_not_called()
|
||||||
_session_mock,
|
|
||||||
id=LB_ID,
|
|
||||||
provisioning_status=constants.ERROR)
|
|
||||||
|
|
||||||
self.assertIsNone(amp)
|
self.assertIsNone(amp)
|
||||||
|
|
||||||
@ -513,10 +510,7 @@ class TestAmphoraDriverTasks(base.TestCase):
|
|||||||
_session_mock,
|
_session_mock,
|
||||||
id=AMP_ID,
|
id=AMP_ID,
|
||||||
status=constants.ERROR)
|
status=constants.ERROR)
|
||||||
repo.LoadBalancerRepository.update.assert_called_once_with(
|
repo.LoadBalancerRepository.update.assert_not_called()
|
||||||
_session_mock,
|
|
||||||
id=LB_ID,
|
|
||||||
provisioning_status=constants.ERROR)
|
|
||||||
|
|
||||||
self.assertIsNone(amp)
|
self.assertIsNone(amp)
|
||||||
|
|
||||||
@ -546,33 +540,6 @@ class TestAmphoraDriverTasks(base.TestCase):
|
|||||||
mock_driver.post_vip_plug.assert_called_once_with(
|
mock_driver.post_vip_plug.assert_called_once_with(
|
||||||
_amphora_mock, _LB_mock, amphorae_net_config_mock)
|
_amphora_mock, _LB_mock, amphorae_net_config_mock)
|
||||||
|
|
||||||
# Test revert
|
|
||||||
amp = amphora_post_vip_plug_obj.revert(None, _LB_mock)
|
|
||||||
repo.LoadBalancerRepository.update.assert_called_once_with(
|
|
||||||
_session_mock,
|
|
||||||
id=LB_ID,
|
|
||||||
provisioning_status=constants.ERROR)
|
|
||||||
|
|
||||||
self.assertIsNone(amp)
|
|
||||||
|
|
||||||
# Test revert with exception
|
|
||||||
repo.LoadBalancerRepository.update.reset_mock()
|
|
||||||
mock_loadbalancer_repo_update.side_effect = Exception('fail')
|
|
||||||
amp = amphora_post_vip_plug_obj.revert(None, _LB_mock)
|
|
||||||
repo.LoadBalancerRepository.update.assert_called_once_with(
|
|
||||||
_session_mock,
|
|
||||||
id=LB_ID,
|
|
||||||
provisioning_status=constants.ERROR)
|
|
||||||
|
|
||||||
self.assertIsNone(amp)
|
|
||||||
|
|
||||||
# Test revert when this task failed
|
|
||||||
repo.AmphoraRepository.update.reset_mock()
|
|
||||||
amp = amphora_post_vip_plug_obj.revert(
|
|
||||||
failure.Failure.from_exception(Exception('boom')), _amphora_mock,
|
|
||||||
None)
|
|
||||||
repo.AmphoraRepository.update.assert_not_called()
|
|
||||||
|
|
||||||
def test_amphora_cert_upload(self,
|
def test_amphora_cert_upload(self,
|
||||||
mock_driver,
|
mock_driver,
|
||||||
mock_generate_uuid,
|
mock_generate_uuid,
|
||||||
|
@ -955,10 +955,7 @@ class TestDatabaseTasks(base.TestCase):
|
|||||||
'TEST',
|
'TEST',
|
||||||
id=LISTENER_ID,
|
id=LISTENER_ID,
|
||||||
provisioning_status=constants.ERROR)
|
provisioning_status=constants.ERROR)
|
||||||
repo.LoadBalancerRepository.update.assert_called_once_with(
|
repo.LoadBalancerRepository.update.assert_not_called()
|
||||||
'TEST',
|
|
||||||
id=LB_ID,
|
|
||||||
provisioning_status=constants.ERROR)
|
|
||||||
|
|
||||||
# Test the revert with exceptions
|
# Test the revert with exceptions
|
||||||
mock_loadbalancer_repo_update.reset_mock()
|
mock_loadbalancer_repo_update.reset_mock()
|
||||||
@ -973,10 +970,7 @@ class TestDatabaseTasks(base.TestCase):
|
|||||||
'TEST',
|
'TEST',
|
||||||
id=LISTENER_ID,
|
id=LISTENER_ID,
|
||||||
provisioning_status=constants.ERROR)
|
provisioning_status=constants.ERROR)
|
||||||
repo.LoadBalancerRepository.update.assert_called_once_with(
|
repo.LoadBalancerRepository.update.assert_not_called()
|
||||||
'TEST',
|
|
||||||
id=LB_ID,
|
|
||||||
provisioning_status=constants.ERROR)
|
|
||||||
|
|
||||||
@mock.patch('octavia.common.tls_utils.cert_parser.get_cert_expiration',
|
@mock.patch('octavia.common.tls_utils.cert_parser.get_cert_expiration',
|
||||||
return_value=_cert_mock)
|
return_value=_cert_mock)
|
||||||
@ -1040,10 +1034,7 @@ class TestDatabaseTasks(base.TestCase):
|
|||||||
mock_loadbalancer_repo_update.reset_mock()
|
mock_loadbalancer_repo_update.reset_mock()
|
||||||
mark_loadbalancer_active.revert(self.loadbalancer_mock)
|
mark_loadbalancer_active.revert(self.loadbalancer_mock)
|
||||||
|
|
||||||
repo.LoadBalancerRepository.update.assert_called_once_with(
|
repo.LoadBalancerRepository.update.assert_not_called()
|
||||||
'TEST',
|
|
||||||
id=LB_ID,
|
|
||||||
provisioning_status=constants.ERROR)
|
|
||||||
self.assertEqual(0, repo.ListenerRepository.update.call_count)
|
self.assertEqual(0, repo.ListenerRepository.update.call_count)
|
||||||
|
|
||||||
# Test the revert with exception
|
# Test the revert with exception
|
||||||
@ -1051,10 +1042,7 @@ class TestDatabaseTasks(base.TestCase):
|
|||||||
mock_loadbalancer_repo_update.side_effect = Exception('fail')
|
mock_loadbalancer_repo_update.side_effect = Exception('fail')
|
||||||
mark_loadbalancer_active.revert(self.loadbalancer_mock)
|
mark_loadbalancer_active.revert(self.loadbalancer_mock)
|
||||||
|
|
||||||
repo.LoadBalancerRepository.update.assert_called_once_with(
|
repo.LoadBalancerRepository.update.assert_not_called()
|
||||||
'TEST',
|
|
||||||
id=LB_ID,
|
|
||||||
provisioning_status=constants.ERROR)
|
|
||||||
self.assertEqual(0, repo.ListenerRepository.update.call_count)
|
self.assertEqual(0, repo.ListenerRepository.update.call_count)
|
||||||
|
|
||||||
def test_mark_LB_active_in_db_and_listeners(self,
|
def test_mark_LB_active_in_db_and_listeners(self,
|
||||||
@ -1086,10 +1074,7 @@ class TestDatabaseTasks(base.TestCase):
|
|||||||
mock_listener_repo_update.reset_mock()
|
mock_listener_repo_update.reset_mock()
|
||||||
mark_lb_active.revert(lb)
|
mark_lb_active.revert(lb)
|
||||||
|
|
||||||
repo.LoadBalancerRepository.update.assert_called_once_with(
|
repo.LoadBalancerRepository.update.assert_not_called()
|
||||||
'TEST',
|
|
||||||
id=lb.id,
|
|
||||||
provisioning_status=constants.ERROR)
|
|
||||||
self.assertEqual(2, repo.ListenerRepository.update.call_count)
|
self.assertEqual(2, repo.ListenerRepository.update.call_count)
|
||||||
repo.ListenerRepository.update.has_calls(
|
repo.ListenerRepository.update.has_calls(
|
||||||
[mock.call('TEST', listeners[0].id,
|
[mock.call('TEST', listeners[0].id,
|
||||||
@ -1192,10 +1177,7 @@ class TestDatabaseTasks(base.TestCase):
|
|||||||
mock_l7r_repo_update.reset_mock()
|
mock_l7r_repo_update.reset_mock()
|
||||||
mark_lb_active.revert(lb)
|
mark_lb_active.revert(lb)
|
||||||
|
|
||||||
repo.LoadBalancerRepository.update.assert_called_once_with(
|
repo.LoadBalancerRepository.update.assert_not_called()
|
||||||
'TEST',
|
|
||||||
id=lb.id,
|
|
||||||
provisioning_status=constants.ERROR)
|
|
||||||
self.assertEqual(2, repo.ListenerRepository.update.call_count)
|
self.assertEqual(2, repo.ListenerRepository.update.call_count)
|
||||||
repo.ListenerRepository.update.has_calls(
|
repo.ListenerRepository.update.has_calls(
|
||||||
[mock.call('TEST', listeners[0].id,
|
[mock.call('TEST', listeners[0].id,
|
||||||
@ -1252,20 +1234,14 @@ class TestDatabaseTasks(base.TestCase):
|
|||||||
mock_loadbalancer_repo_update.reset_mock()
|
mock_loadbalancer_repo_update.reset_mock()
|
||||||
mark_loadbalancer_deleted.revert(self.loadbalancer_mock)
|
mark_loadbalancer_deleted.revert(self.loadbalancer_mock)
|
||||||
|
|
||||||
repo.LoadBalancerRepository.update.assert_called_once_with(
|
repo.LoadBalancerRepository.update.assert_not_called()
|
||||||
'TEST',
|
|
||||||
id=LB_ID,
|
|
||||||
provisioning_status=constants.ERROR)
|
|
||||||
|
|
||||||
# Test the revert with exception
|
# Test the revert with exception
|
||||||
mock_loadbalancer_repo_update.reset_mock()
|
mock_loadbalancer_repo_update.reset_mock()
|
||||||
mock_loadbalancer_repo_update.side_effect = Exception('fail')
|
mock_loadbalancer_repo_update.side_effect = Exception('fail')
|
||||||
mark_loadbalancer_deleted.revert(self.loadbalancer_mock)
|
mark_loadbalancer_deleted.revert(self.loadbalancer_mock)
|
||||||
|
|
||||||
repo.LoadBalancerRepository.update.assert_called_once_with(
|
repo.LoadBalancerRepository.update.assert_not_called()
|
||||||
'TEST',
|
|
||||||
id=LB_ID,
|
|
||||||
provisioning_status=constants.ERROR)
|
|
||||||
|
|
||||||
def test_mark_LB_pending_deleted_in_db(self,
|
def test_mark_LB_pending_deleted_in_db(self,
|
||||||
mock_generate_uuid,
|
mock_generate_uuid,
|
||||||
@ -1285,25 +1261,6 @@ class TestDatabaseTasks(base.TestCase):
|
|||||||
LB_ID,
|
LB_ID,
|
||||||
provisioning_status=constants.PENDING_DELETE)
|
provisioning_status=constants.PENDING_DELETE)
|
||||||
|
|
||||||
# Test the revert
|
|
||||||
mock_loadbalancer_repo_update.reset_mock()
|
|
||||||
mark_loadbalancer_pending_delete.revert(self.loadbalancer_mock)
|
|
||||||
|
|
||||||
repo.LoadBalancerRepository.update.assert_called_once_with(
|
|
||||||
'TEST',
|
|
||||||
id=LB_ID,
|
|
||||||
provisioning_status=constants.ERROR)
|
|
||||||
|
|
||||||
# Test the revert with exception
|
|
||||||
mock_loadbalancer_repo_update.reset_mock()
|
|
||||||
mock_loadbalancer_repo_update.side_effect = Exception('fail')
|
|
||||||
mark_loadbalancer_pending_delete.revert(self.loadbalancer_mock)
|
|
||||||
|
|
||||||
repo.LoadBalancerRepository.update.assert_called_once_with(
|
|
||||||
'TEST',
|
|
||||||
id=LB_ID,
|
|
||||||
provisioning_status=constants.ERROR)
|
|
||||||
|
|
||||||
@mock.patch('octavia.db.repositories.HealthMonitorRepository.update')
|
@mock.patch('octavia.db.repositories.HealthMonitorRepository.update')
|
||||||
def test_update_health_monitor_in_db(self,
|
def test_update_health_monitor_in_db(self,
|
||||||
mock_health_mon_repo_update,
|
mock_health_mon_repo_update,
|
||||||
@ -1361,25 +1318,6 @@ class TestDatabaseTasks(base.TestCase):
|
|||||||
LB_ID,
|
LB_ID,
|
||||||
name='test', description='test2')
|
name='test', description='test2')
|
||||||
|
|
||||||
# Test the revert
|
|
||||||
mock_loadbalancer_repo_update.reset_mock()
|
|
||||||
update_load_balancer.revert(self.loadbalancer_mock)
|
|
||||||
|
|
||||||
repo.LoadBalancerRepository.update.assert_called_once_with(
|
|
||||||
'TEST',
|
|
||||||
id=LB_ID,
|
|
||||||
provisioning_status=constants.ERROR)
|
|
||||||
|
|
||||||
# Test the revert with exception
|
|
||||||
mock_loadbalancer_repo_update.reset_mock()
|
|
||||||
mock_loadbalancer_repo_update.side_effect = Exception('fail')
|
|
||||||
update_load_balancer.revert(self.loadbalancer_mock)
|
|
||||||
|
|
||||||
repo.LoadBalancerRepository.update.assert_called_once_with(
|
|
||||||
'TEST',
|
|
||||||
id=LB_ID,
|
|
||||||
provisioning_status=constants.ERROR)
|
|
||||||
|
|
||||||
@mock.patch('octavia.db.repositories.VipRepository.update')
|
@mock.patch('octavia.db.repositories.VipRepository.update')
|
||||||
def test_update_vip_in_db_during_update_loadbalancer(self,
|
def test_update_vip_in_db_during_update_loadbalancer(self,
|
||||||
mock_vip_update,
|
mock_vip_update,
|
||||||
|
@ -342,10 +342,11 @@ class TestAmphoraFlows(base.TestCase):
|
|||||||
self.assertIsInstance(amp_flow, flow.Flow)
|
self.assertIsInstance(amp_flow, flow.Flow)
|
||||||
|
|
||||||
self.assertIn(constants.LOADBALANCER_ID, amp_flow.requires)
|
self.assertIn(constants.LOADBALANCER_ID, amp_flow.requires)
|
||||||
|
self.assertIn(constants.LOADBALANCER, amp_flow.requires)
|
||||||
|
|
||||||
self.assertIn(constants.VIP_SG_ID, amp_flow.provides)
|
self.assertIn(constants.VIP_SG_ID, amp_flow.provides)
|
||||||
|
|
||||||
self.assertEqual(1, len(amp_flow.requires))
|
self.assertEqual(2, len(amp_flow.requires))
|
||||||
self.assertEqual(1, len(amp_flow.provides))
|
self.assertEqual(1, len(amp_flow.provides))
|
||||||
|
|
||||||
def test_cert_rotate_amphora_flow(self, mock_get_net_driver):
|
def test_cert_rotate_amphora_flow(self, mock_get_net_driver):
|
||||||
|
@ -557,10 +557,7 @@ class TestAmphoraDriverTasks(base.TestCase):
|
|||||||
_session_mock,
|
_session_mock,
|
||||||
id=AMP_ID,
|
id=AMP_ID,
|
||||||
status=constants.ERROR)
|
status=constants.ERROR)
|
||||||
repo.LoadBalancerRepository.update.assert_called_once_with(
|
repo.LoadBalancerRepository.update.assert_not_called()
|
||||||
_session_mock,
|
|
||||||
id=LB_ID,
|
|
||||||
provisioning_status=constants.ERROR)
|
|
||||||
|
|
||||||
self.assertIsNone(amp)
|
self.assertIsNone(amp)
|
||||||
|
|
||||||
@ -574,10 +571,7 @@ class TestAmphoraDriverTasks(base.TestCase):
|
|||||||
_session_mock,
|
_session_mock,
|
||||||
id=AMP_ID,
|
id=AMP_ID,
|
||||||
status=constants.ERROR)
|
status=constants.ERROR)
|
||||||
repo.LoadBalancerRepository.update.assert_called_once_with(
|
repo.LoadBalancerRepository.update.assert_not_called()
|
||||||
_session_mock,
|
|
||||||
id=LB_ID,
|
|
||||||
provisioning_status=constants.ERROR)
|
|
||||||
|
|
||||||
self.assertIsNone(amp)
|
self.assertIsNone(amp)
|
||||||
|
|
||||||
@ -664,33 +658,6 @@ class TestAmphoraDriverTasks(base.TestCase):
|
|||||||
_db_amphora_mock, _db_load_balancer_mock, amphorae_net_config_mock,
|
_db_amphora_mock, _db_load_balancer_mock, amphorae_net_config_mock,
|
||||||
vip_subnet=vip_subnet, vrrp_port=vrrp_port)
|
vip_subnet=vip_subnet, vrrp_port=vrrp_port)
|
||||||
|
|
||||||
# Test revert
|
|
||||||
amp = amphora_post_vip_plug_obj.revert(None, _LB_mock)
|
|
||||||
repo.LoadBalancerRepository.update.assert_called_once_with(
|
|
||||||
_session_mock,
|
|
||||||
id=LB_ID,
|
|
||||||
provisioning_status=constants.ERROR)
|
|
||||||
|
|
||||||
self.assertIsNone(amp)
|
|
||||||
|
|
||||||
# Test revert with exception
|
|
||||||
repo.LoadBalancerRepository.update.reset_mock()
|
|
||||||
mock_loadbalancer_repo_update.side_effect = Exception('fail')
|
|
||||||
amp = amphora_post_vip_plug_obj.revert(None, _LB_mock)
|
|
||||||
repo.LoadBalancerRepository.update.assert_called_once_with(
|
|
||||||
_session_mock,
|
|
||||||
id=LB_ID,
|
|
||||||
provisioning_status=constants.ERROR)
|
|
||||||
|
|
||||||
self.assertIsNone(amp)
|
|
||||||
|
|
||||||
# Test revert when this task failed
|
|
||||||
repo.AmphoraRepository.update.reset_mock()
|
|
||||||
amp = amphora_post_vip_plug_obj.revert(
|
|
||||||
failure.Failure.from_exception(Exception('boom')), _amphora_mock,
|
|
||||||
None)
|
|
||||||
repo.AmphoraRepository.update.assert_not_called()
|
|
||||||
|
|
||||||
def test_amphora_cert_upload(self,
|
def test_amphora_cert_upload(self,
|
||||||
mock_driver,
|
mock_driver,
|
||||||
mock_generate_uuid,
|
mock_generate_uuid,
|
||||||
|
@ -1027,10 +1027,7 @@ class TestDatabaseTasks(base.TestCase):
|
|||||||
'TEST',
|
'TEST',
|
||||||
id=LISTENER_ID,
|
id=LISTENER_ID,
|
||||||
provisioning_status=constants.ERROR)
|
provisioning_status=constants.ERROR)
|
||||||
repo.LoadBalancerRepository.update.assert_called_once_with(
|
repo.LoadBalancerRepository.update.assert_not_called()
|
||||||
'TEST',
|
|
||||||
id=LB_ID,
|
|
||||||
provisioning_status=constants.ERROR)
|
|
||||||
|
|
||||||
# Test the revert LB_ID from listeners
|
# Test the revert LB_ID from listeners
|
||||||
mock_loadbalancer_repo_update.reset_mock()
|
mock_loadbalancer_repo_update.reset_mock()
|
||||||
@ -1042,10 +1039,7 @@ class TestDatabaseTasks(base.TestCase):
|
|||||||
'TEST',
|
'TEST',
|
||||||
id=LISTENER_ID,
|
id=LISTENER_ID,
|
||||||
provisioning_status=constants.ERROR)
|
provisioning_status=constants.ERROR)
|
||||||
repo.LoadBalancerRepository.update.assert_called_once_with(
|
repo.LoadBalancerRepository.update.assert_not_called()
|
||||||
'TEST',
|
|
||||||
id=LB_ID,
|
|
||||||
provisioning_status=constants.ERROR)
|
|
||||||
|
|
||||||
# Test the revert no LB_ID
|
# Test the revert no LB_ID
|
||||||
mock_loadbalancer_repo_update.reset_mock()
|
mock_loadbalancer_repo_update.reset_mock()
|
||||||
@ -1068,10 +1062,7 @@ class TestDatabaseTasks(base.TestCase):
|
|||||||
'TEST',
|
'TEST',
|
||||||
id=LISTENER_ID,
|
id=LISTENER_ID,
|
||||||
provisioning_status=constants.ERROR)
|
provisioning_status=constants.ERROR)
|
||||||
repo.LoadBalancerRepository.update.assert_called_once_with(
|
repo.LoadBalancerRepository.update.assert_not_called()
|
||||||
'TEST',
|
|
||||||
id=LB_ID,
|
|
||||||
provisioning_status=constants.ERROR)
|
|
||||||
|
|
||||||
@mock.patch('octavia.common.tls_utils.cert_parser.get_cert_expiration',
|
@mock.patch('octavia.common.tls_utils.cert_parser.get_cert_expiration',
|
||||||
return_value=_cert_mock)
|
return_value=_cert_mock)
|
||||||
@ -1135,10 +1126,7 @@ class TestDatabaseTasks(base.TestCase):
|
|||||||
mock_loadbalancer_repo_update.reset_mock()
|
mock_loadbalancer_repo_update.reset_mock()
|
||||||
mark_loadbalancer_active.revert(self.loadbalancer_mock)
|
mark_loadbalancer_active.revert(self.loadbalancer_mock)
|
||||||
|
|
||||||
repo.LoadBalancerRepository.update.assert_called_once_with(
|
repo.LoadBalancerRepository.update.assert_not_called()
|
||||||
'TEST',
|
|
||||||
id=LB_ID,
|
|
||||||
provisioning_status=constants.ERROR)
|
|
||||||
self.assertEqual(0, repo.ListenerRepository.update.call_count)
|
self.assertEqual(0, repo.ListenerRepository.update.call_count)
|
||||||
|
|
||||||
# Test the revert with exception
|
# Test the revert with exception
|
||||||
@ -1146,10 +1134,7 @@ class TestDatabaseTasks(base.TestCase):
|
|||||||
mock_loadbalancer_repo_update.side_effect = Exception('fail')
|
mock_loadbalancer_repo_update.side_effect = Exception('fail')
|
||||||
mark_loadbalancer_active.revert(self.loadbalancer_mock)
|
mark_loadbalancer_active.revert(self.loadbalancer_mock)
|
||||||
|
|
||||||
repo.LoadBalancerRepository.update.assert_called_once_with(
|
repo.LoadBalancerRepository.update.assert_not_called()
|
||||||
'TEST',
|
|
||||||
id=LB_ID,
|
|
||||||
provisioning_status=constants.ERROR)
|
|
||||||
self.assertEqual(0, repo.ListenerRepository.update.call_count)
|
self.assertEqual(0, repo.ListenerRepository.update.call_count)
|
||||||
|
|
||||||
def test_mark_LB_active_in_db_by_listener(self,
|
def test_mark_LB_active_in_db_by_listener(self,
|
||||||
@ -1175,10 +1160,7 @@ class TestDatabaseTasks(base.TestCase):
|
|||||||
mock_loadbalancer_repo_update.reset_mock()
|
mock_loadbalancer_repo_update.reset_mock()
|
||||||
mark_loadbalancer_active.revert(listener_dict)
|
mark_loadbalancer_active.revert(listener_dict)
|
||||||
|
|
||||||
repo.LoadBalancerRepository.update.assert_called_once_with(
|
repo.LoadBalancerRepository.update.assert_not_called()
|
||||||
'TEST',
|
|
||||||
id=LB_ID,
|
|
||||||
provisioning_status=constants.ERROR)
|
|
||||||
self.assertEqual(0, repo.ListenerRepository.update.call_count)
|
self.assertEqual(0, repo.ListenerRepository.update.call_count)
|
||||||
|
|
||||||
# Test the revert with exception
|
# Test the revert with exception
|
||||||
@ -1186,10 +1168,7 @@ class TestDatabaseTasks(base.TestCase):
|
|||||||
mock_loadbalancer_repo_update.side_effect = Exception('fail')
|
mock_loadbalancer_repo_update.side_effect = Exception('fail')
|
||||||
mark_loadbalancer_active.revert(listener_dict)
|
mark_loadbalancer_active.revert(listener_dict)
|
||||||
|
|
||||||
repo.LoadBalancerRepository.update.assert_called_once_with(
|
repo.LoadBalancerRepository.update.assert_not_called()
|
||||||
'TEST',
|
|
||||||
id=LB_ID,
|
|
||||||
provisioning_status=constants.ERROR)
|
|
||||||
self.assertEqual(0, repo.ListenerRepository.update.call_count)
|
self.assertEqual(0, repo.ListenerRepository.update.call_count)
|
||||||
|
|
||||||
@mock.patch('octavia.db.repositories.LoadBalancerRepository.get')
|
@mock.patch('octavia.db.repositories.LoadBalancerRepository.get')
|
||||||
@ -1224,10 +1203,7 @@ class TestDatabaseTasks(base.TestCase):
|
|||||||
mock_listener_repo_update.reset_mock()
|
mock_listener_repo_update.reset_mock()
|
||||||
mark_lb_active.revert(self.loadbalancer_mock)
|
mark_lb_active.revert(self.loadbalancer_mock)
|
||||||
|
|
||||||
repo.LoadBalancerRepository.update.assert_called_once_with(
|
repo.LoadBalancerRepository.update.assert_not_called()
|
||||||
'TEST',
|
|
||||||
id=lb.id,
|
|
||||||
provisioning_status=constants.ERROR)
|
|
||||||
self.assertEqual(2, repo.ListenerRepository.update.call_count)
|
self.assertEqual(2, repo.ListenerRepository.update.call_count)
|
||||||
repo.ListenerRepository.update.has_calls(
|
repo.ListenerRepository.update.has_calls(
|
||||||
[mock.call('TEST', listeners[0].id,
|
[mock.call('TEST', listeners[0].id,
|
||||||
@ -1319,10 +1295,7 @@ class TestDatabaseTasks(base.TestCase):
|
|||||||
mock_l7r_repo_update.reset_mock()
|
mock_l7r_repo_update.reset_mock()
|
||||||
mark_lb_active.revert(self.loadbalancer_mock)
|
mark_lb_active.revert(self.loadbalancer_mock)
|
||||||
|
|
||||||
repo.LoadBalancerRepository.update.assert_called_once_with(
|
repo.LoadBalancerRepository.update.assert_not_called()
|
||||||
'TEST',
|
|
||||||
id=lb.id,
|
|
||||||
provisioning_status=constants.ERROR)
|
|
||||||
self.assertEqual(2, repo.ListenerRepository.update.call_count)
|
self.assertEqual(2, repo.ListenerRepository.update.call_count)
|
||||||
repo.ListenerRepository.update.has_calls(
|
repo.ListenerRepository.update.has_calls(
|
||||||
[mock.call('TEST', listeners[0].id,
|
[mock.call('TEST', listeners[0].id,
|
||||||
@ -1368,20 +1341,14 @@ class TestDatabaseTasks(base.TestCase):
|
|||||||
mock_loadbalancer_repo_update.reset_mock()
|
mock_loadbalancer_repo_update.reset_mock()
|
||||||
mark_loadbalancer_deleted.revert(self.loadbalancer_mock)
|
mark_loadbalancer_deleted.revert(self.loadbalancer_mock)
|
||||||
|
|
||||||
repo.LoadBalancerRepository.update.assert_called_once_with(
|
repo.LoadBalancerRepository.update.assert_not_called()
|
||||||
'TEST',
|
|
||||||
id=LB_ID,
|
|
||||||
provisioning_status=constants.ERROR)
|
|
||||||
|
|
||||||
# Test the revert with exception
|
# Test the revert with exception
|
||||||
mock_loadbalancer_repo_update.reset_mock()
|
mock_loadbalancer_repo_update.reset_mock()
|
||||||
mock_loadbalancer_repo_update.side_effect = Exception('fail')
|
mock_loadbalancer_repo_update.side_effect = Exception('fail')
|
||||||
mark_loadbalancer_deleted.revert(self.loadbalancer_mock)
|
mark_loadbalancer_deleted.revert(self.loadbalancer_mock)
|
||||||
|
|
||||||
repo.LoadBalancerRepository.update.assert_called_once_with(
|
repo.LoadBalancerRepository.update.assert_not_called()
|
||||||
'TEST',
|
|
||||||
id=LB_ID,
|
|
||||||
provisioning_status=constants.ERROR)
|
|
||||||
|
|
||||||
def test_mark_LB_pending_deleted_in_db(self,
|
def test_mark_LB_pending_deleted_in_db(self,
|
||||||
mock_generate_uuid,
|
mock_generate_uuid,
|
||||||
@ -1401,25 +1368,6 @@ class TestDatabaseTasks(base.TestCase):
|
|||||||
LB_ID,
|
LB_ID,
|
||||||
provisioning_status=constants.PENDING_DELETE)
|
provisioning_status=constants.PENDING_DELETE)
|
||||||
|
|
||||||
# Test the revert
|
|
||||||
mock_loadbalancer_repo_update.reset_mock()
|
|
||||||
mark_loadbalancer_pending_delete.revert(self.loadbalancer_mock)
|
|
||||||
|
|
||||||
repo.LoadBalancerRepository.update.assert_called_once_with(
|
|
||||||
'TEST',
|
|
||||||
id=LB_ID,
|
|
||||||
provisioning_status=constants.ERROR)
|
|
||||||
|
|
||||||
# Test the revert with exception
|
|
||||||
mock_loadbalancer_repo_update.reset_mock()
|
|
||||||
mock_loadbalancer_repo_update.side_effect = Exception('fail')
|
|
||||||
mark_loadbalancer_pending_delete.revert(self.loadbalancer_mock)
|
|
||||||
|
|
||||||
repo.LoadBalancerRepository.update.assert_called_once_with(
|
|
||||||
'TEST',
|
|
||||||
id=LB_ID,
|
|
||||||
provisioning_status=constants.ERROR)
|
|
||||||
|
|
||||||
@mock.patch('octavia.db.repositories.HealthMonitorRepository.update')
|
@mock.patch('octavia.db.repositories.HealthMonitorRepository.update')
|
||||||
def test_update_health_monitor_in_db(self,
|
def test_update_health_monitor_in_db(self,
|
||||||
mock_health_mon_repo_update,
|
mock_health_mon_repo_update,
|
||||||
@ -1477,25 +1425,6 @@ class TestDatabaseTasks(base.TestCase):
|
|||||||
LB_ID,
|
LB_ID,
|
||||||
name='test', description='test2')
|
name='test', description='test2')
|
||||||
|
|
||||||
# Test the revert
|
|
||||||
mock_loadbalancer_repo_update.reset_mock()
|
|
||||||
update_load_balancer.revert(self.loadbalancer_mock)
|
|
||||||
|
|
||||||
repo.LoadBalancerRepository.update.assert_called_once_with(
|
|
||||||
'TEST',
|
|
||||||
id=LB_ID,
|
|
||||||
provisioning_status=constants.ERROR)
|
|
||||||
|
|
||||||
# Test the revert with exception
|
|
||||||
mock_loadbalancer_repo_update.reset_mock()
|
|
||||||
mock_loadbalancer_repo_update.side_effect = Exception('fail')
|
|
||||||
update_load_balancer.revert(self.loadbalancer_mock)
|
|
||||||
|
|
||||||
repo.LoadBalancerRepository.update.assert_called_once_with(
|
|
||||||
'TEST',
|
|
||||||
id=LB_ID,
|
|
||||||
provisioning_status=constants.ERROR)
|
|
||||||
|
|
||||||
@mock.patch('octavia.db.repositories.VipRepository.update')
|
@mock.patch('octavia.db.repositories.VipRepository.update')
|
||||||
def test_update_vip_in_db_during_update_loadbalancer(self,
|
def test_update_vip_in_db_during_update_loadbalancer(self,
|
||||||
mock_vip_update,
|
mock_vip_update,
|
||||||
|
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- |
|
||||||
|
Fix an issue with the provisioning status of a load balancer that was set
|
||||||
|
to ERROR too early when an error occurred, making the load balancer mutable
|
||||||
|
while the execution of the tasks for this resources haven't finished yet.
|
||||||
|
- |
|
||||||
|
Fix an issue that could set the provisioning status of a load balancer to a
|
||||||
|
PENDING_UPDATE state when an error occurred in the amphora failover flow.
|
Loading…
x
Reference in New Issue
Block a user