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 thecumin.transport.Transport
factory class. Each transport module need to define aworker_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:
config (dict) -- the configuration dictionary.
target (cumin.transports.Target) -- a Target instance.
- Returns:
the created worker instance for the configured transport.
- Return type:
- 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.