Pass and use original sys.argv to/with workers
This gets used e.g. by argparse for the "prog" part. We could explicitly pass it through and/or set it on config._parser.prog, but that is a bit tedious just for this use case, and it looks like "simulating" the main prog here appears to not be that bad of a hack after all.
This commit is contained in:
@@ -2,6 +2,7 @@ from __future__ import print_function
|
||||
import fnmatch
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
import threading
|
||||
|
||||
import py
|
||||
@@ -213,6 +214,7 @@ class WorkerController(object):
|
||||
"workercount": len(nodemanager.specs),
|
||||
"slaveid": gateway.id,
|
||||
"slavecount": len(nodemanager.specs),
|
||||
"mainargv": sys.argv,
|
||||
}
|
||||
# TODO: deprecated name, backward compatibility only. Remove it in future
|
||||
self.slaveinput = self.workerinput
|
||||
|
||||
Reference in New Issue
Block a user