Skip to content

Commit

Permalink
vm: raise CalledProcessError on failed service/command call
Browse files Browse the repository at this point in the history
  • Loading branch information
marmarek committed Jun 20, 2017
1 parent 51a17ba commit 6044325
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions qubes/vm/qubesvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1095,10 +1095,8 @@ def run_service_for_stdio(self, *args, input=None, **kwargs):
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

Expand Down Expand Up @@ -1142,10 +1140,8 @@ def run_for_stdio(self, *args, input=None, **kwargs):
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

Expand Down

0 comments on commit 6044325

Please sign in to comment.