From ad92b3bc4bd2c1596b68446d64c18dd142b31c9e Mon Sep 17 00:00:00 2001 From: alesaggio Date: Mon, 15 Oct 2018 15:16:20 +0200 Subject: [PATCH] fix das query --- python/das_import.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/python/das_import.py b/python/das_import.py index 9e217b5..6d87750 100755 --- a/python/das_import.py +++ b/python/das_import.py @@ -10,8 +10,12 @@ def do_das_query(query): Execute das_client for the specified query, and return parsed JSON output """ - args = ['dasgoclient', '-json', '-format', 'json', '--query', query] - result = subprocess.check_output(args) + args = ['dasgoclient', '--format', 'json', '--query', query] + + try: + result = subprocess.check_output(args) + except subprocess.CalledProcessError as exc: + result = exc.output return json.loads(result) @@ -46,7 +50,7 @@ def query_das(dataset): """ summary_query = "summary dataset=%s" % dataset - metadata_query = "dataset=%s" % dataset + metadata_query = "dataset dataset=%s" % dataset release_query = "release dataset=%s" % dataset config_query = "config dataset=%s system=dbs3" % dataset