Skip to content

Commit

Permalink
use das_client wrapper instead of the python das_client module
Browse files Browse the repository at this point in the history
  • Loading branch information
vbotta committed Aug 26, 2016
1 parent 068e4ef commit 3ae9811
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Alignment/OfflineValidation/python/TkAlAllInOneTool/dataset.py
@@ -1,7 +1,7 @@
# idea stolen from:
# http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/CMSSW/
# PhysicsTools/PatAlgos/python/tools/cmsswVersionTools.py
import das_client
import Utilities.General.cmssw_das_client as das_client
import json
import os
import bisect
Expand Down Expand Up @@ -337,8 +337,7 @@ def forcerunrangefunction(s):
return forcerunrangefunction

def __getData( self, dasQuery, dasLimit = 0 ):
dasData = das_client.get_data( 'https://cmsweb.cern.ch',
dasQuery, 0, dasLimit, False )
dasData = das_client.get_data(dasQuery, dasLimit)
if isinstance(dasData, str):
jsondict = json.loads( dasData )
else:
Expand All @@ -349,7 +348,10 @@ def __getData( self, dasQuery, dasLimit = 0 ):
except KeyError:
error = None
if error or self.__findInJson(jsondict,"status") != 'ok' or "data" not in jsondict:
jsonstr = str(jsondict)
try:
jsonstr = self.__findInJson(jsondict,"reason")
except KeyError:
jsonstr = str(jsondict)
if len(jsonstr) > 10000:
jsonfile = "das_query_output_%i.txt"
i = 0
Expand Down

0 comments on commit 3ae9811

Please sign in to comment.