Commit 7197dd72 authored by Jonathan Schaeffer's avatar Jonathan Schaeffer
Browse files

Better subprocess management

parent 4995128b
......@@ -145,9 +145,9 @@ def seedtree(content):
def wfcatalog(content):
# launch wfcatalog updates, 100 files for each run
for chunk in grouper(content.splitlines(), 50):
logger.info("launching WFCatalog update on : %s" % str(chunk))
logger.info("launching WFCatalog collector on : %s" % str(chunk))
files = json.dumps(chunk)
sp = subprocess.Popen(
sp = subprocess.run(
[
"python3",
"./wfcatalog/collector/WFCatalogCollector.py",
......@@ -156,12 +156,10 @@ def wfcatalog(content):
"--stdout",
"--list",
files,
], stdout=subprocess.PIPE)
(out, err) = sp.communicate()
if out:
logger.info("WFCatalog standard output:\n%s", out.decode('utf-8'))
if err:
logger.info("WFCatalog standard error:\n%s", err.decode('utf-8'))
], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
logger.info("WFCollector exit status: %s", sp.returncode)
logger.ingo("WFCollector stdout:\n%s", sp.stdout.decode())
logger.info("WFCatalog stderr:\n%s", sp.stderr.decode())
if __name__ == "__main__":
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment