Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(520)

Unified Diff: client/run_isolated.py

Issue 2443663002: Pass args in file from task_runner to run_isolated (Closed)
Patch Set: Respond to code review comments other than changes to options processing Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: client/run_isolated.py
diff --git a/client/run_isolated.py b/client/run_isolated.py
index 7c3f063793c8f1356e4ceeb5697043fed212788a..1c18deca8f79159415960cf9a4d6c4c063e626c2 100755
--- a/client/run_isolated.py
+++ b/client/run_isolated.py
@@ -31,6 +31,7 @@ __version__ = '0.8.5'
import base64
import collections
+import json
import logging
import optparse
import os
@@ -823,10 +824,24 @@ def main(args):
print >> sys.stderr, ex.message
return 1
+def get_args(args):
+ if len(args) == 2 and args[0] == '-f':
M-A Ruel 2016/10/24 16:26:52 then create a temporary optparse with only the -f
+ # If the only args are "-f filename", load those
+ # instead.
+ argfile = args[1]
+ args = []
+ try:
+ f = open(argfile, 'r')
+ args = json.loads(f.read())
+ f.close()
+ except Exception as e:
+ print "Couldn't read arguments: %s"%e
+ return args
if __name__ == '__main__':
subprocess42.inhibit_os_error_reporting()
# Ensure that we are always running with the correct encoding.
fix_encoding.fix_encoding()
file_path.enable_symlink()
- sys.exit(main(sys.argv[1:]))
+
+ sys.exit(main(get_args(sys.argv[1:])))

Powered by Google App Engine
This is Rietveld 408576698