From 6c6f6f402383baaa53cb14f31813654a6c6c0279 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 13 Sep 2023 19:29:45 -0400 Subject: SL-19242: Pass arbitrary subprocess kwds through run_command(). That is, make LLManifest.run_command() accept and forward subprocess keyword arguments. --- indra/lib/python/indra/util/llmanifest.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'indra/lib') diff --git a/indra/lib/python/indra/util/llmanifest.py b/indra/lib/python/indra/util/llmanifest.py index 820f356dae..bcb9d884c3 100755 --- a/indra/lib/python/indra/util/llmanifest.py +++ b/indra/lib/python/indra/util/llmanifest.py @@ -38,6 +38,7 @@ import itertools import operator import os import re +import shlex import shutil import subprocess import sys @@ -531,15 +532,15 @@ class LLManifest(object, metaclass=LLManifestRegistry): self.cmakedirs(path) return path - def run_command(self, command): + def run_command(self, command, **kwds): """ Runs an external command. Raises ManifestError exception if the command returns a nonzero status. """ - print("Running command:", command) + print("Running command:", shlex.join(command)) sys.stdout.flush() try: - subprocess.check_call(command) + subprocess.check_call(command, **kwds) except subprocess.CalledProcessError as err: raise ManifestError( "Command %s returned non-zero status (%s)" % (command, err.returncode) ) -- cgit v1.2.3