action_utils: Handle capture_output argument in run wrapper

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
Sunil Mohan Adapa 2025-08-17 08:47:43 -07:00 committed by Veiko Aasa
parent e227e9a919
commit c8f89e3ca5
No known key found for this signature in database
GPG Key ID: 478539CAE680674E

View File

@ -825,8 +825,10 @@ def run_as_user(command, username, **kwargs):
def run(command, **kwargs):
"""Run subprocess.run but capture stdout and stderr in thread storage."""
collect_stdout = ('stdout' not in kwargs)
collect_stderr = ('stderr' not in kwargs)
collect_stdout = ('stdout' not in kwargs
and 'capture_output' not in kwargs)
collect_stderr = ('stderr' not in kwargs
and 'capture_output' not in kwargs)
if collect_stdout:
kwargs['stdout'] = subprocess.PIPE