paradrop.backend.exc package

Submodules

paradrop.backend.exc.executionplan module

abortPlans(update)[source]

This function should be called if one of the Plan objects throws an Exception. It takes the PlanMap argument and calls the getNextAbort function just like executePlans does with todoPlans. This dynamically generates an abort plan list based on what plans were originally executed. Returns:

True in error : This is really bad False otherwise : we were able to restore system state back to before the executeplans function was called
aggregatePlans(update)[source]

Takes the PlanMap provided which can be a combination of changes for multiple different chutes and it puts things into a sane order and removes duplicates where possible.

This keeps things like reloading networking from happening twice if 2 chutes make changes.

Returns:
A new PlanMap that should be executed
executePlans(update)[source]

Primary function that actually executes all the functions that were added to plans by all the exc modules. This function can heavily modify the OS/files/etc.. so the return value is very important. Returns:

True in error : abortPlans function should be called False otherwise : everything is OK
generatePlans(update)[source]

For an update object provided this function references the updateModuleList which lets all exc modules determine if they need to add functions to change the state of the system when new chutes are added to the OS.

Returns: True in error, as in we should stop with this update plan

paradrop.backend.exc.files module

generateFilesPlan(chuteStor, newChute, chutePlan)[source]

This function looks at a diff of the current Chute (in @chuteStor) and the @newChute, then adds Plan() calls to make the Chute match the @newChute.

Returns:
None : means continue to pass this chute update to the rest of the chain. True : means stop updating, but its ok (no errors or anything) str : means stop updating, but some error occured (contained in the string)
generatePlans(update)[source]

This function looks at a diff of the current Chute (in @chuteStor) and the @newChute, then adds Plan() calls to make the Chute match the @newChute.

Returns:
True: abort the plan generation process

paradrop.backend.exc.name module

generatePlans(update)[source]

This function looks at a diff of the current Chute (in @chuteStor) and the @newChute, then adds Plan() calls to make the Chute match the @newChute.

Returns:
True: abort the plan generation process

paradrop.backend.exc.plangraph module

class Plan(func, *args)[source]

Helper class to hold onto the actual plan data associated with each plan

class PlanMap(name)[source]

This class helps build a dependency graph required to determine what steps are required to update a Chute from a previous version of its configuration.

addMap(other)[source]

Takes another PlanMap object and appends whatever the plans are into this plans object.

addPlans(priority, todoPlan, abortPlan=[])[source]

Adds new Plan objects into the list of plans for this PlanMap.

Arguments:

@priority : The priority number (1 is done first, 99 done last - see PRIORITYFLAGS section at top of this file) @todoPlan : A tuple of (function, (args)), this is the function that completes the actual task requested

the args can either be a single variable, a tuple of variables, or None.
@abortPlan : A tuple of (function, (args)) or None. This is what should be called if a plan somewhere in the chain
fails and we need to undo the work we did here - this function is only called if a higher priority function fails (ie we were called, then something later on fails that would cause us to undo everything we did to setup/change the Chute).
getNextAbort()[source]

Like an iterator function, it returns each element in the list of abort plans in order.

Returns:
(function, args) : Each todo is returned just how the user first added it None : None is returned when there are no more todo’s
getNextTodo()[source]

Like an iterator function, it returns each element in the list of plans in order.

Returns:
(function, args) : Each todo is returned just how the user first added it None : None is returned when there are no more todo’s
registerSkip(func)[source]

Register this function as one to skip execution on, if provided it shouldn’t return the (func, args) tuple as a result from the getNextTodo function.

sort()[source]

Sorts the plans based on priority.

paradrop.backend.exc.resource module

generatePlans(update)[source]

This function looks at a diff of the current Chute (in @chuteStor) and the @newChute, then adds Plan() calls to make the Chute match the @newChute.

Returns:
True: abort the plan generation process
generateResourcePlan(chuteStor, newChute, chutePlan)[source]

This function looks at a diff of the current Chute (in @chuteStor) and the @newChute, then adds Plan() calls to make the Chute match the @newChute.

Returns:
None : means continue to pass this chute update to the rest of the chain. True : means stop updating, but its ok (no errors or anything) str : means stop updating, but some error occured (contained in the string)

paradrop.backend.exc.runtime module

generatePlans(update)[source]

This function looks at a diff of the current Chute (in @chuteStor) and the @newChute, then adds Plan() calls to make the Chute match the @newChute.

Returns:
True: abort the plan generation process

paradrop.backend.exc.state module

generatePlans(update)[source]

This function looks at a diff of the current Chute (in @chuteStor) and the @newChute, then adds Plan() calls to make the Chute match the @newChute.

Returns:
True: abort the plan generation process
generateStatePlan(chuteStor, newChute, chutePlan)[source]

This function looks at a diff of the current Chute (in @chuteStor) and the @newChute, then adds Plan() calls to make the Chute match the @newChute.

Returns:
None : means continue to pass this chute update to the rest of the chain. True : means stop updating, but its ok (no errors or anything) str : means stop updating, but some error occured (contained in the string)

paradrop.backend.exc.struct module

generatePlans(update)[source]

This function looks at a diff of the current Chute (in @chuteStor) and the @newChute, then adds Plan() calls to make the Chute match the @newChute.

Returns:
True: abort the plan generation process

paradrop.backend.exc.traffic module

generatePlans(update)[source]

This function looks at a diff of the current Chute (in @chuteStor) and the @newChute, then adds Plan() calls to make the Chute match the @newChute.

Returns:
True: abort the plan generation process
generateTrafficPlan(chuteStor, newChute, chutePlan)[source]

This function looks at a diff of the current Chute (in @chuteStor) and the @newChute, then adds Plan() calls to make the Chute match the @newChute.

Returns:
None : means continue to pass this chute update to the rest of the chain. True : means stop updating, but its ok (no errors or anything) str : means stop updating, but some error occured (contained in the string)

Module contents