paradrop.core.update package


paradrop.core.update.update_fetcher module

Fetch new updates from the pdserver and apply the updates

class UpdateFetcher(update_manager)[source]

Bases: object


Start updates by polling the server for the latest updates.

This is the only method that needs to be called from outside. The rest are triggered asynchronously.

Call chain: pull_update -> _updates_received -> _update_complete

_auto: Set to True when called by the scheduled LoopingCall.


paradrop.core.update.update_manager module

class UpdateManager(reactor)[source]

This class is in charge of making the configuration changes required on the chutes. It utilizes the ChuteStorage class to hold onto the chute data.

Use @updateChutes to make the configuration changes on the AP.
This function is thread-safe, this class will only call one update set at a time. All others are held in a queue until the last update is complete.
add_provision_update(hostconfig_patch, zerotier_networks)[source]

MUTEX: updateLock Take the list of Chutes and push the list into a queue object, this object will then call the real update function in another thread so the function that called us is not blocked.

We take a callable responseFunction to call, when we are done with this update we should call it.


Get a unique change ID for an update.

This should be used to set the change_id field in an update object.


MUTEX: updateLock Clears all updates from list (new array).


Search active and queued changes for the requested change.

Returns an Update object or None.

paradrop.core.update.update_object module

This holds onto the UpdateObject class. It allows us to easily abstract away different update types and provide a uniform way to interpret the results through a set of basic actionable functions.

class UpdateChute(obj, reuse_existing=False)[source]

Bases: paradrop.core.update.update_object.UpdateObject

Updates specifically tailored to chute actions like create, delete, etc…


Check whether this update involves building a chute.

updateModuleList = [<module '' from '/home/docs/checkouts/'>, <module 'paradrop.core.plan.state' from '/home/docs/checkouts/'>, <module 'paradrop.core.plan.struct' from '/home/docs/checkouts/'>, <module 'paradrop.core.plan.resource' from '/home/docs/checkouts/'>, <module 'paradrop.core.plan.traffic' from '/home/docs/checkouts/'>, <module 'paradrop.core.plan.runtime' from '/home/docs/checkouts/'>]
class UpdateObject(obj)[source]

Bases: object

The base UpdateObject class, covers a few basic methods but otherwise all the intelligence exists in the inherited classes.

All update information passed by the API server is contained as variables of this class such as update.updateType, update.updateClass, etc…

By default, the following variables should be utilized:

responses : an array of messages any module can choose to append warnings or errors to

failure : the module that chose to fail this update can set a string message to return
: to the user in the failure variable. It should be very clear as to why the : failure occurred, but if the user wants more information they may find it : in the responses variable which may contain debug information, etc…
cache_get(key, default=None)[source]

Get a value from the cache or the default value if it does not exist.

cache_set(key, value)[source]

Set a value in the cache.


Signal to the API server that any action we need to perform is complete and the API server can finish its connection with the client that initiated the API request.


The function that actually walks through the main process required to create the chute. It follows the executeplan module through the paces of:

  1. Generate the plans for each plan module
  2. Prioritize the plans
  3. Execute the plans

If at any point we fail then this function will directly take care of completing the update process with an error state and will close the API connection.


Check whether this update involves building a chute.


This function should be called when the updated object is dequeued and execution is about to begin.

Sends a notification to the pdserver if this is a tracked update.

updateModuleList = []
class UpdateRouter(obj)[source]

Bases: paradrop.core.update.update_object.UpdateObject

Updates specifically tailored to router configuration.

updateModuleList = [<module 'paradrop.core.plan.hostconfig' from '/home/docs/checkouts/'>, <module 'paradrop.core.plan.router' from '/home/docs/checkouts/'>]
class UpdateSnap(obj)[source]

Bases: paradrop.core.update.update_object.UpdateObject

Updates specifically tailored to installing snaps.

updateModuleList = [<module 'paradrop.core.plan.snap' from '/home/docs/checkouts/'>]

Determines the update type and returns the proper class.

Module contents