From 60443259d0fe8e61588f815242311b3957729f3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Tue, 20 Jun 2017 17:09:01 +0200 Subject: [PATCH] vm: raise CalledProcessError on failed service/command call --- qubes/vm/qubesvm.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/qubes/vm/qubesvm.py b/qubes/vm/qubesvm.py index 1fbe1d3e..e657d070 100644 --- a/qubes/vm/qubesvm.py +++ b/qubes/vm/qubesvm.py @@ -1095,10 +1095,8 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM): stdouterr = yield from p.communicate(input=input) if p.returncode: - raise qubes.exc.QubesVMError(self, - 'service {!r} failed with retcode {!r}; ' - 'stdout={!r} stderr={!r}'.format( - args[0], p.returncode, *stdouterr)) + raise subprocess.CalledProcessError(p.returncode, + args[0], *stdouterr) return stdouterr @@ -1142,10 +1140,8 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM): stdouterr = yield from p.communicate(input=input) if p.returncode: - raise qubes.exc.QubesVMError(self, - 'service {!r} failed with retcode {!r}; ' - 'stdout={!r} stderr={!r}'.format( - args[0], p.returncode, *stdouterr)) + raise subprocess.CalledProcessError(p.returncode, + args[0], *stdouterr) return stdouterr