def get_update_member_flow(self): """Flow to update a member :returns: The flow for updating a member """ update_member_flow = linear_flow.Flow(constants.UPDATE_MEMBER_FLOW) update_member_flow.add( lifecycle_tasks.MemberToErrorOnRevertTask(requires=[ constants.MEMBER, constants.LISTENERS, constants.LOADBALANCER, constants.POOL ])) update_member_flow.add( database_tasks.MarkMemberPendingUpdateInDB( requires=constants.MEMBER)) update_member_flow.add( a10_database_tasks.GetVThunderByLoadBalancer( requires=constants.LOADBALANCER, provides=a10constants.VTHUNDER)) update_member_flow.add( server_tasks.MemberUpdate(requires=(constants.MEMBER, a10constants.VTHUNDER))) update_member_flow.add( database_tasks.UpdateMemberInDB( requires=[constants.MEMBER, constants.UPDATE_DICT])) update_member_flow.add( database_tasks.MarkMemberActiveInDB(requires=constants.MEMBER)) update_member_flow.add( database_tasks.MarkPoolActiveInDB(requires=constants.POOL)) update_member_flow.add( database_tasks.MarkLBAndListenersActiveInDB( requires=[constants.LOADBALANCER, constants.LISTENERS])) update_member_flow.add( vthunder_tasks.WriteMemory(requires=a10constants.VTHUNDER)) return update_member_flow
def get_update_member_flow(self, topology): """Flow to update a member :returns: The flow for updating a member """ update_member_flow = linear_flow.Flow(constants.UPDATE_MEMBER_FLOW) update_member_flow.add( lifecycle_tasks.MemberToErrorOnRevertTask(requires=[ constants.MEMBER, constants.LISTENERS, constants.LOADBALANCER, constants.POOL ])) update_member_flow.add( vthunder_tasks.VthunderInstanceBusy( requires=a10constants.COMPUTE_BUSY)) update_member_flow.add( database_tasks.MarkMemberPendingUpdateInDB( requires=constants.MEMBER)) update_member_flow.add( a10_database_tasks.GetVThunderByLoadBalancer( requires=constants.LOADBALANCER, provides=a10constants.VTHUNDER)) if topology == constants.TOPOLOGY_ACTIVE_STANDBY: update_member_flow.add( vthunder_tasks.GetMasterVThunder( name=a10constants.GET_MASTER_VTHUNDER, requires=a10constants.VTHUNDER, provides=a10constants.VTHUNDER)) update_member_flow.add(self.handle_vrid_for_member_subflow()) update_member_flow.add( a10_database_tasks.GetFlavorData( rebind={a10constants.LB_RESOURCE: constants.LOADBALANCER}, provides=constants.FLAVOR)) update_member_flow.add( server_tasks.MemberUpdate(requires=(constants.MEMBER, a10constants.VTHUNDER, constants.POOL, constants.FLAVOR, constants.UPDATE_DICT))) update_member_flow.add( database_tasks.UpdateMemberInDB( requires=[constants.MEMBER, constants.UPDATE_DICT])) update_member_flow.add( database_tasks.MarkMemberActiveInDB(requires=constants.MEMBER)) update_member_flow.add( database_tasks.MarkPoolActiveInDB(requires=constants.POOL)) update_member_flow.add( database_tasks.MarkLBAndListenersActiveInDB( requires=[constants.LOADBALANCER, constants.LISTENERS])) update_member_flow.add( vthunder_tasks.WriteMemory(requires=a10constants.VTHUNDER)) update_member_flow.add( a10_database_tasks.SetThunderUpdatedAt( requires=a10constants.VTHUNDER)) return update_member_flow
def get_rack_vthunder_update_member_flow(self): """Flow to update a member in Thunder devices :returns: The flow for updating a member """ update_member_flow = linear_flow.Flow(constants.UPDATE_MEMBER_FLOW) update_member_flow.add( lifecycle_tasks.MemberToErrorOnRevertTask(requires=[ constants.MEMBER, constants.LISTENERS, constants.LOADBALANCER, constants.POOL ])) update_member_flow.add( database_tasks.MarkMemberPendingUpdateInDB( requires=constants.MEMBER)) update_member_flow.add( a10_database_tasks.GetVThunderByLoadBalancer( requires=constants.LOADBALANCER, provides=a10constants.VTHUNDER)) update_member_flow.add( vthunder_tasks.SetupDeviceNetworkMap( requires=a10constants.VTHUNDER, provides=a10constants.VTHUNDER)) # Handle VRID settings update_member_flow.add(self.handle_vrid_for_member_subflow()) update_member_flow.add( a10_database_tasks.GetFlavorData( rebind={a10constants.LB_RESOURCE: constants.LOADBALANCER}, provides=constants.FLAVOR)) update_member_flow.add( server_tasks.MemberUpdate(requires=(constants.MEMBER, a10constants.VTHUNDER, constants.POOL, constants.FLAVOR))) update_member_flow.add( database_tasks.UpdateMemberInDB( requires=[constants.MEMBER, constants.UPDATE_DICT])) if CONF.a10_global.network_type == 'vlan': update_member_flow.add( vthunder_tasks.TagInterfaceForMember( requires=[constants.MEMBER, a10constants.VTHUNDER])) update_member_flow.add( database_tasks.MarkMemberActiveInDB(requires=constants.MEMBER)) update_member_flow.add( database_tasks.MarkPoolActiveInDB(requires=constants.POOL)) update_member_flow.add( database_tasks.MarkLBAndListenersActiveInDB( requires=[constants.LOADBALANCER, constants.LISTENERS])) update_member_flow.add( vthunder_tasks.WriteMemory(requires=a10constants.VTHUNDER)) update_member_flow.add( a10_database_tasks.SetThunderUpdatedAt( requires=a10constants.VTHUNDER)) return update_member_flow
def get_update_member_flow(self): """Create a flow to update a member :returns: The flow for updating a member """ update_member_flow = linear_flow.Flow(constants.UPDATE_MEMBER_FLOW) update_member_flow.add( lifecycle_tasks.MemberToErrorOnRevertTask(requires=[ constants.MEMBER, constants.LISTENERS, constants.LOADBALANCER, constants.POOL ])) update_member_flow.add( database_tasks.MarkMemberPendingUpdateInDB( requires=constants.MEMBER)) update_member_flow.add( a10_database_tasks.GetVThunderByLoadBalancer( requires=constants.LOADBALANCER, provides=a10constants.VTHUNDER)) # Handle VRID settings update_member_flow.add( a10_database_tasks.GetVRIDForProjectMember( requires=constants.MEMBER, provides=a10constants.VRID)) update_member_flow.add( a10_network_tasks.HandleVRIDFloatingIP(requires=[ constants.MEMBER, a10constants.VTHUNDER, a10constants.VRID ], provides=a10constants.PORT)) update_member_flow.add( a10_database_tasks.UpdateVRIDForProjectMember(requires=[ constants.MEMBER, a10constants.VRID, a10constants.PORT ])) update_member_flow.add( server_tasks.MemberUpdate(requires=(constants.MEMBER, a10constants.VTHUNDER))) update_member_flow.add( database_tasks.UpdateMemberInDB( requires=[constants.MEMBER, constants.UPDATE_DICT])) update_member_flow.add( database_tasks.MarkMemberActiveInDB(requires=constants.MEMBER)) update_member_flow.add( database_tasks.MarkPoolActiveInDB(requires=constants.POOL)) update_member_flow.add( database_tasks.MarkLBAndListenersActiveInDB( requires=[constants.LOADBALANCER, constants.LISTENERS])) return update_member_flow