diff options
author | Dan Crosta <dcrosta@10gen.com> | 2012-02-23 17:28:59 -0500 |
---|---|---|
committer | Dan Crosta <dcrosta@10gen.com> | 2012-02-23 17:32:02 -0500 |
commit | 51e9b45d893ab822f3885c42d7347572b977c1f6 (patch) | |
tree | d3452c72c97ef1f9d379150bb59a83c72f295f9c /buildscripts/utils.py | |
parent | 51fbd62859b801431cad4625804dfadbe26e6496 (diff) | |
download | mongo-51e9b45d893ab822f3885c42d7347572b977c1f6.tar.gz |
SERVER-5057 safely invoke smoke.py from SConscript.smoke
this correctly handles arguments with spaces, quotes, etc
Diffstat (limited to 'buildscripts/utils.py')
-rw-r--r-- | buildscripts/utils.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/buildscripts/utils.py b/buildscripts/utils.py index f107930de80..15020feff34 100644 --- a/buildscripts/utils.py +++ b/buildscripts/utils.py @@ -176,9 +176,15 @@ def find_python(min_version=(2, 5)): raise Exception('could not find suitable Python (version >= %s)' % '.'.join(min_version)) def smoke_command(*args): + # return a list of arguments that comprises a complete + # invocation of smoke.py here = os.path.dirname(__file__) smoke_py = os.path.abspath(os.path.join(here, 'smoke.py')) - return ' '.join(itertools.chain( - (find_python(), smoke_py), - args)) + return [find_python(), smoke_py] + list(args) + +def run_smoke_command(*args): + # to run a command line script from a scons Alias (or any + # Action), the command sequence must be enclosed in a list, + # otherwise SCons treats it as a list of dependencies. + return [smoke_command(*args)] |