]> xenbits.xensource.com Git - qemu-xen.git/commit
python/utils: add VerboseProcessError
authorJohn Snow <jsnow@redhat.com>
Mon, 21 Mar 2022 20:16:02 +0000 (16:16 -0400)
committerHanna Reitz <hreitz@redhat.com>
Tue, 22 Mar 2022 09:14:23 +0000 (10:14 +0100)
commit062fd1dad2640d1c2522b71ddde4ba0bbdc8c6d9
tree880e9ff717df3bbcb1eea604b39334d945ad111d
parentbe73231ba836c34502af5ff419ab3ca23c60a6db
python/utils: add VerboseProcessError

This adds an Exception that extends the Python stdlib
subprocess.CalledProcessError.

The difference is that the str() method of this exception also adds the
stdout/stderr logs. In effect, if this exception goes unhandled, Python
will print the output in a visually distinct wrapper to the terminal so
that it's easy to spot in a sea of traceback information.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220321201618.903471-3-jsnow@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
python/qemu/utils/__init__.py