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_unplug_vip(self, mock_get_net_driver):
        mock_driver = mock.MagicMock()
        mock_get_net_driver.return_value = mock_driver
        net = network_tasks.UnplugVIP()

        net.execute(LB)
        mock_driver.unplug_vip.assert_called_once_with(LB, LB.vip)
Ejemplo n.º 3
0
    def test_unplug_vip(self, mock_get_session, mock_get_lb,
                        mock_get_net_driver):
        mock_driver = mock.MagicMock()
        mock_get_lb.return_value = LB
        mock_get_net_driver.return_value = mock_driver
        net = network_tasks.UnplugVIP()

        net.execute(self.load_balancer_mock)
        mock_driver.unplug_vip.assert_called_once_with(LB, LB.vip)