def checked_run(cmd):
    """Prepare and run a subprocess cmd, checking for successful completion."""
    completed_process = run(cmd)
    if completed_process.returncode > 0:
        print("Command failed!  Hanging around in case someone needs a "
              "docker connection. (Ctrl-C to quit now)")
        time.sleep(300)
        raise RuntimeError
    return completed_process
Prepare and run a subprocess cmd, checking for successful completion.