Python API

Cumin Python API autodoc.

Automation and orchestration framework written in Python.

class cumin.Config[source]

Bases: dict

Singleton-like dictionary class to load the configuration from a given path only once.

static __new__(cls, config='/etc/cumin/config.yaml')[source]

Load the given configuration if not already loaded and return it.

Called by Python's data model for each new instantiation of the class.

Parameters

config (str, optional) -- path to the configuration file to load.

Returns

the configuration dictionary.

Return type

dict

Examples

>>> import cumin
>>> config = cumin.Config()
exception cumin.CuminError[source]

Bases: Exception

Base Exception class for all Cumin's custom Exceptions.

cumin.nodeset(nodes=None)[source]

Instantiate a ClusterShell NodeSet with the resolver defaulting to RESOLVER_NOGROUP.

This allow to avoid any conflict with Cumin grammars.

Returns

the instantiated NodeSet.

Return type

ClusterShell.NodeSet.NodeSet

cumin.nodeset_fromlist(nodelist)[source]

Instantiate a ClusterShell NodeSet from a list with the resolver defaulting to RESOLVER_NOGROUP.

This allow to avoid any conflict with Cumin grammars.

Returns

the instantiated NodeSet.

Return type

ClusterShell.NodeSet.NodeSet

cumin.parse_config(config_file)[source]

Parse the YAML configuration file.

Parameters

config_file (str) -- the path of the configuration file to load.

Returns

the configuration dictionary.

Return type

dict

Raises

CuminError -- if unable to read or parse the configuration.

cumin.trace(self, msg, *args, **kwargs)[source]

Additional logging level for development debugging.

Parameters

according to logging.Logger interface for log levels.

cumin.__version__ = '0.1.dev2+gce88641'

the version of the current Cumin module.

Type

str

Subpackages and Submodules