Beispiel #1
0
 def _get_delete_load_balancer_flow(self, lb, cascade):
     store = {}
     delete_LB_flow = linear_flow.Flow(constants.DELETE_LOADBALANCER_FLOW)
     delete_LB_flow.add(lifecycle_tasks.LoadBalancerToErrorOnRevertTask(
         requires=constants.LOADBALANCER))
     delete_LB_flow.add(compute_tasks.NovaServerGroupDelete(
         requires=constants.SERVER_GROUP_ID))
     delete_LB_flow.add(database_tasks.MarkLBAmphoraeHealthBusy(
         requires=constants.LOADBALANCER))
     if cascade:
         (listeners_delete, store) = self._get_delete_listeners_flow(lb)
         (pools_delete, pool_store) = self._get_delete_pools_flow(lb)
         store.update(pool_store)
         delete_LB_flow.add(pools_delete)
         delete_LB_flow.add(listeners_delete)
     delete_LB_flow.add(network_tasks.UnplugVIP(
         requires=constants.LOADBALANCER))
     delete_LB_flow.add(network_tasks.DeallocateVIP(
         requires=constants.LOADBALANCER))
     delete_LB_flow.add(compute_tasks.DeleteAmphoraeOnLoadBalancer(
         requires=constants.LOADBALANCER))
     delete_LB_flow.add(database_tasks.MarkLBAmphoraeDeletedInDB(
         requires=constants.LOADBALANCER))
     delete_LB_flow.add(database_tasks.DisableLBAmphoraeHealthMonitoring(
         requires=constants.LOADBALANCER))
     delete_LB_flow.add(database_tasks.MarkLBDeletedInDB(
         requires=constants.LOADBALANCER))
     delete_LB_flow.add(database_tasks.DecrementLoadBalancerQuota(
         requires=constants.LOADBALANCER))
     return (delete_LB_flow, store)
Beispiel #2
0
    def test_delete_amphorae_on_load_balancer(self, mock_driver):

        mock_driver.delete.side_effect = [mock.DEFAULT,
                                          exceptions.OctaviaException('boom')]

        delete_amps = compute_tasks.DeleteAmphoraeOnLoadBalancer()

        delete_amps.execute(_load_balancer_mock)

        mock_driver.delete.assert_called_once_with(COMPUTE_ID)

        # Test compute driver exception is raised
        self.assertRaises(exceptions.OctaviaException, delete_amps.execute,
                          _load_balancer_mock)
Beispiel #3
0
    def test_delete_amphorae_on_load_balancer(self, mock_driver):

        delete_amps = compute_tasks.DeleteAmphoraeOnLoadBalancer()
        delete_amps.execute(_load_balancer_mock)

        mock_driver.delete.assert_called_once_with(COMPUTE_ID)