Commit 52510c9a authored by Jonathan Schaeffer's avatar Jonathan Schaeffer
Browse files

Try with python module

parent 19f159ae
[submodule "wfcatalog"]
path = wfcatalog
url = https://github.com/EIDA/wfcatalog.git
url = git@github.com:EIDA/wfcatalog.git
branch = sdsbynet
......@@ -14,6 +14,7 @@ import traceback
from proton.utils import BlockingConnection
from proton import Message
import resif_pyinventory
from wfcatalog.collector.WFCatalogCollector import WFCatalogCollector
SCRIPT_VERSION = 2021.190
......@@ -144,22 +145,11 @@ def seedtree(content):
def wfcatalog(content):
# launch wfcatalog updates, 100 files for each run
wfcollector = WFCatalogCollector()
for chunk in grouper(content.splitlines(), 50):
logger.info("launching WFCatalog collector on : %s" % str(chunk))
files = json.dumps(chunk)
sp = subprocess.run(
[
"python3",
"./wfcatalog/collector/WFCatalogCollector.py",
"--update",
"--force",
"--stdout",
"--list",
files,
], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
logger.info("WFCollector exit status: %s", sp.returncode)
logger.info("WFCollector stdout:\n%s", sp.stdout.decode())
logger.info("WFCatalog stderr:\n%s", sp.stderr.decode())
wfcollector.process({'update': True, 'force': True, 'stdout': True, 'csegs': True, 'flags': True, 'list': files})
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