Transport

Transport factory.

class cumin.transport.Transport[source]

Bases: object

Transport factory class.

The transport layer is the one used to convey the commands to be executed into the selected hosts. The transport abstraction allow to specify a mode to choose the execution plan, an event handler class and a success threshold. Those can be used by the chosen transport to customize the behavior of the execution plan.

All the transports share a common interface that is defined in the cumin.transports.BaseWorker class and they are instantiated through the cumin.transport.Transport factory class. Each transport module need to define a worker_class module variable that is a pointer to the transport class for dynamic instantiation.

static new(config, target)[source]

Create a transport worker class based on the configuration (factory).

Parameters:
Returns:

the created worker instance for the configured transport.

Return type:

BaseWorker

Raises:
  • cumin.CuminError -- if the configuration is missing the required transport key.
  • exceptions.ImportError -- if unable to import the transport module.
  • exceptions.AttributeError -- if the transport module is missing the required worker_class attribute.