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)
|
stdouterr = yield from p.communicate(input=input)
|
||||||
|
|
||||||
if p.returncode:
|
if p.returncode:
|
||||||
raise qubes.exc.QubesVMError(self,
|
raise subprocess.CalledProcessError(p.returncode,
|
||||||
'service {!r} failed with retcode {!r}; '
|
args[0], *stdouterr)
|
||||||
'stdout={!r} stderr={!r}'.format(
|
|
||||||
args[0], p.returncode, *stdouterr))
|
|
||||||
|
|
||||||
return stdouterr
|
return stdouterr
|
||||||
|
|
||||||
@ -1142,10 +1140,8 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
|
|||||||
stdouterr = yield from p.communicate(input=input)
|
stdouterr = yield from p.communicate(input=input)
|
||||||
|
|
||||||
if p.returncode:
|
if p.returncode:
|
||||||
raise qubes.exc.QubesVMError(self,
|
raise subprocess.CalledProcessError(p.returncode,
|
||||||
'service {!r} failed with retcode {!r}; '
|
args[0], *stdouterr)
|
||||||
'stdout={!r} stderr={!r}'.format(
|
|
||||||
args[0], p.returncode, *stdouterr))
|
|
||||||
|
|
||||||
return stdouterr
|
return stdouterr
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user