call_proc¶
- getmac.utils.call_proc(executable, args)[source]¶
Wrapper around
subprocess.check_output()with some logging and type conversion.The reason this and
getmac.utils.popen()are separate functions is to make it easier to mock for unit tests.- Parameters:
- Return type:
- Returns:
stdout from the command (stderr is discarded)
- Raises:
CalledProcessError – the command failed to execute
TimeoutExpired – the command took longer than
COMMAND_TIMEOUTseconds, and was stopped