def get_update_pool_flow(self): """Create a flow to update a pool :returns: The flow for updating a pool """ update_pool_flow = linear_flow.Flow(constants.UPDATE_POOL_FLOW) update_pool_flow.add( lifecycle_tasks.PoolToErrorOnRevertTask(requires=[ constants.POOL, constants.LISTENERS, constants.LOADBALANCER ])) update_pool_flow.add( database_tasks.MarkPoolPendingUpdateInDB(requires=constants.POOL)) update_pool_flow.add( model_tasks.UpdateAttributes( rebind={constants.OBJECT: constants.POOL}, requires=[constants.UPDATE_DICT])) update_pool_flow.add( amphora_driver_tasks.ListenersUpdate( requires=[constants.LOADBALANCER, constants.LISTENERS])) update_pool_flow.add( database_tasks.UpdatePoolInDB( requires=[constants.POOL, constants.UPDATE_DICT])) update_pool_flow.add( database_tasks.MarkPoolActiveInDB(requires=constants.POOL)) update_pool_flow.add( database_tasks.MarkLBAndListenersActiveInDB( requires=[constants.LOADBALANCER, constants.LISTENERS])) return update_pool_flow
def get_update_pool_flow(self): """Create a flow to update a pool :returns: The flow for updating a pool """ update_pool_flow = linear_flow.Flow(constants.UPDATE_POOL_FLOW) update_pool_flow.add(lifecycle_tasks.PoolToErrorOnRevertTask( requires=[constants.POOL, constants.LISTENERS, constants.LOADBALANCER])) update_pool_flow.add(database_tasks.MarkPoolPendingUpdateInDB( requires=constants.POOL)) update_pool_flow.add(a10_database_tasks.GetVThunderByLoadBalancer( requires=constants.LOADBALANCER, provides=a10constants.VTHUNDER)) update_pool = service_group_tasks.PoolUpdate( requires=[constants.POOL, a10constants.VTHUNDER, constants.UPDATE_DICT], provides=constants.POOL) update_pool_flow.add(*self._get_sess_pers_subflow(update_pool)) update_pool_flow.add(virtual_port_tasks.ListenersUpdate( requires=[constants.LOADBALANCER, constants.LISTENERS, a10constants.VTHUNDER])) update_pool_flow.add(database_tasks.UpdatePoolInDB( requires=[constants.POOL, constants.UPDATE_DICT])) update_pool_flow.add(database_tasks.MarkPoolActiveInDB( requires=constants.POOL)) update_pool_flow.add(database_tasks.MarkLBAndListenersActiveInDB( requires=[constants.LOADBALANCER, constants.LISTENERS])) return update_pool_flow
def get_update_pool_flow(self, topology): """Create a flow to update a pool :returns: The flow for updating a pool """ update_pool_flow = linear_flow.Flow(constants.UPDATE_POOL_FLOW) update_pool_flow.add(lifecycle_tasks.PoolToErrorOnRevertTask( requires=[constants.POOL, constants.LISTENERS, constants.LOADBALANCER])) update_pool_flow.add(vthunder_tasks.VthunderInstanceBusy( requires=a10constants.COMPUTE_BUSY)) update_pool_flow.add(database_tasks.MarkPoolPendingUpdateInDB( requires=constants.POOL)) update_pool_flow.add(a10_database_tasks.GetVThunderByLoadBalancer( requires=constants.LOADBALANCER, provides=a10constants.VTHUNDER)) if topology == constants.TOPOLOGY_ACTIVE_STANDBY: update_pool_flow.add(vthunder_tasks.GetMasterVThunder( name=a10constants.GET_MASTER_VTHUNDER, requires=a10constants.VTHUNDER, provides=a10constants.VTHUNDER)) update_pool_flow.add(a10_database_tasks.GetFlavorData( rebind={a10constants.LB_RESOURCE: constants.POOL}, provides=constants.FLAVOR)) update_pool = service_group_tasks.PoolUpdate( requires=[constants.POOL, a10constants.VTHUNDER, constants.UPDATE_DICT, constants.FLAVOR], provides=constants.POOL) update_pool_flow.add(*self._get_sess_pers_subflow(update_pool)) update_pool_flow.add(virtual_port_tasks.ListenerUpdateForPool( requires=[constants.LOADBALANCER, constants.LISTENER, a10constants.VTHUNDER])) update_pool_flow.add(database_tasks.UpdatePoolInDB( requires=[constants.POOL, constants.UPDATE_DICT])) update_pool_flow.add(database_tasks.MarkPoolActiveInDB( requires=constants.POOL)) update_pool_flow.add(database_tasks.MarkLBAndListenersActiveInDB( requires=[constants.LOADBALANCER, constants.LISTENERS])) update_pool_flow.add(vthunder_tasks.WriteMemory( requires=a10constants.VTHUNDER)) update_pool_flow.add(a10_database_tasks.SetThunderUpdatedAt( requires=a10constants.VTHUNDER)) return update_pool_flow