Ejemplo n.º 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)
Ejemplo n.º 2
0
 def test_deallocate_vip(self, mock_get_net_driver):
     mock_driver = mock.MagicMock()
     mock_get_net_driver.return_value = mock_driver
     net = network_tasks.DeallocateVIP()
     vip = o_data_models.Vip()
     lb = o_data_models.LoadBalancer(vip=vip)
     net.execute(lb)
     mock_driver.deallocate_vip.assert_called_once_with(lb.vip)