Пример #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)
Пример #2
0
    def get_delete_load_balancer_flow(self, lb, deleteCompute):
        """Creates a flow to delete a load balancer.

        :returns: The flow for deleting a load balancer
        """
        #(listeners_delete, store) = self._get_delete_listeners_flow(lb)
        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))
        delete_LB_flow.add(
            a10_database_tasks.GetVThunderByLoadBalancer(
                requires=constants.LOADBALANCER,
                provides=a10constants.VTHUNDER))
        delete_LB_flow.add(
            handler_virtual_server.DeleteVitualServerTask(
                requires=(constants.LOADBALANCER, a10constants.VTHUNDER),
                provides=a10constants.STATUS))
        #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))
        if deleteCompute:
            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(
            a10_database_tasks.DeleteVthunderEntry(
                requires=constants.LOADBALANCER))
        delete_LB_flow.add(
            database_tasks.DecrementLoadBalancerQuota(
                requires=constants.LOADBALANCER))

        return (delete_LB_flow, store)