System-level utilities and helper functions.
Bases: exceptions.Exception
Bases: enum.IntEnum
Enumerations that affect if stdout and stderr are logged on error.
New in version 2.7.
Log an error on each occurence of an error.
No logging on errors.
Log an error on the last attempt that errored only.
Bases: exceptions.Exception
Bases: exceptions.Exception
Bases: object
Resource limits on a process.
Attributes:
This object can be used for the prlimit parameter of execute().
Create a list of arguments for the prlimit command line.
Bases: exceptions.Exception
Helper method to shell out and execute a command through subprocess.
Allows optional retry.
Parameters: |
|
---|---|
Returns: | (stdout, stderr) from process execution |
Raises: | UnknownArgumentError on receiving unknown arguments |
Raises: | |
Raises: | OSError |
The prlimit parameter can be used to set resource limits on the child process. If this parameter is used, the child process will be spawned by a wrapper process which will set limits before spawning the command.
Changed in version 3.4: Added prlimit optional parameter.
Changed in version 1.5: Added cwd optional parameter.
Changed in version 1.9: Added binary optional parameter. On Python 3, stdout and stdout are now returned as Unicode strings by default, or bytes if binary is true.
Changed in version 2.1: Added on_execute and on_completion optional parameters.
Changed in version 2.3: Added preexec_fn optional parameter.
Utility to get the default worker count.
Run a command through SSH.
Changed in version 1.9: Added binary optional parameter.
A wrapper around execute() to more easily handle warnings and errors.
Returns an (out, err) tuple of strings containing the output of the command’s stdout and stderr. If ‘err’ is not empty then the command can be considered to have failed.