This is just a wrapper around python subprocess that I like to use. It originated during cloud-init development.
Some things that I like about it:
- SubpResult prints well.
- times how long subpocesses take, that is available in the SubpResult.
- takes a timeout and a signal to send to the subprocess. The python standard library will only ever send SIGKILL which does not give the process time to cleanup.