Make async_wrapper ignore '_' as an argsfile. (#4678)
This provides support for passing additional positional parameters to async_wrapper. Additional parameters will be used by the upcoming async support for Windows.
This commit is contained in:
parent
b0ef99c73b
commit
05c6707a32
1 changed files with 4 additions and 3 deletions
|
@ -120,7 +120,7 @@ def _run_module(wrapped_cmd, jid, job_path):
|
||||||
####################
|
####################
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
||||||
if len(sys.argv) < 3:
|
if len(sys.argv) < 5:
|
||||||
print(json.dumps({
|
print(json.dumps({
|
||||||
"failed" : True,
|
"failed" : True,
|
||||||
"msg" : "usage: async_wrapper <jid> <time_limit> <modulescript> <argsfile>. Humans, do not call directly!"
|
"msg" : "usage: async_wrapper <jid> <time_limit> <modulescript> <argsfile>. Humans, do not call directly!"
|
||||||
|
@ -130,8 +130,9 @@ if __name__ == '__main__':
|
||||||
jid = "%s.%d" % (sys.argv[1], os.getpid())
|
jid = "%s.%d" % (sys.argv[1], os.getpid())
|
||||||
time_limit = sys.argv[2]
|
time_limit = sys.argv[2]
|
||||||
wrapped_module = sys.argv[3]
|
wrapped_module = sys.argv[3]
|
||||||
if len(sys.argv) >= 5:
|
argsfile = sys.argv[4]
|
||||||
argsfile = sys.argv[4]
|
# consider underscore as no argsfile so we can support passing of additional positional parameters
|
||||||
|
if argsfile != '_':
|
||||||
cmd = "%s %s" % (wrapped_module, argsfile)
|
cmd = "%s %s" % (wrapped_module, argsfile)
|
||||||
else:
|
else:
|
||||||
cmd = wrapped_module
|
cmd = wrapped_module
|
||||||
|
|
Loading…
Reference in a new issue