osbuild/util/ostree: convert cli to return the completed process object
And also set stdout=subprocess.PIPE. This will allow for callers to parse and use the output of the command, but has the side effect of meaning less gets printed to the screen during run. Co-authored-by: Luke Yang <luyang@redhat.com>
This commit is contained in:
parent
e605a3eea0
commit
2e6a3c96ce
1 changed files with 5 additions and 5 deletions
|
|
@ -199,11 +199,11 @@ def cli(*args, _input=None, **kwargs):
|
|||
"""Thin wrapper for running the ostree CLI"""
|
||||
args = list(args) + [f'--{k}={v}' for k, v in kwargs.items()]
|
||||
print("ostree " + " ".join(args), file=sys.stderr)
|
||||
subprocess.run(["ostree"] + args,
|
||||
encoding="utf8",
|
||||
stdout=sys.stderr,
|
||||
input=_input,
|
||||
check=True)
|
||||
return subprocess.run(["ostree"] + args,
|
||||
encoding="utf8",
|
||||
stdout=subprocess.PIPE,
|
||||
input=_input,
|
||||
check=True)
|
||||
|
||||
|
||||
def parse_input_commits(commits):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue