scd.utils

A set of various utils, used within scd.

scd.utils.execute(command)

Executor of external command and wrapper for result.

This is a wrapper for subprocess.Popen with stdin set to /dev/null.

It returns result like:

{
    "code": 0,
    "stdout": ["this is a line of stdout", "and this is another"],
    "stderr": []
}
Parameters:command (list[str]) – A command for subprocess.Popen to execute.
Returns:Execution result.
Return type:dict
Raises:ValueError – if command is not possible to execute.
scd.utils.get_plugins(namespace)

A mapping of plugins (loaded) in given namespace.

Parameters:namespace (str) – The name of namespace to use.
Returns:Mapping for plugins (key is the name and value is loaded plugin).
Return type:dict
scd.utils.get_version_plugins()

A mapping of scd version plugins.