vm: raise CalledProcessError on failed service/command call
This commit is contained in:
parent
51a17ba749
commit
60443259d0
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user