Skip to content

Commit

Permalink
Fix errors from using published dataset names
Browse files Browse the repository at this point in the history
  • Loading branch information
hroskes committed Nov 18, 2014
1 parent 7cc576f commit c0332a8
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Alignment/OfflineValidation/python/TkAlAllInOneTool/dataset.py
Expand Up @@ -172,7 +172,10 @@ def __find_ge( self, a, x):
def __getData( self, dasQuery, dasLimit = 0 ):
dasData = das_client.get_data( 'https://cmsweb.cern.ch',
dasQuery, 0, dasLimit, False )
jsondict = json.loads( dasData )
if isinstance(dasData, str):
jsondict = json.loads( dasData )
else:
jsondict = dasData
# Check, if the DAS query fails
if jsondict["status"] != 'ok':
msg = "Status not 'ok', but:", jsondict["status"]
Expand All @@ -183,7 +186,11 @@ def __getDataType( self ):
dasQuery_type = ( 'dataset dataset=%s | grep dataset.datatype,'
'dataset.name'%( self.__name ) )
data = self.__getData( dasQuery_type )
return data[0]["dataset"][0]["datatype"]
for a in data[0]["dataset"]:
if "datatype" in a:
return a["datatype"]
msg = ("Cannot find the datatype of the dataset '%s'"%( self.name() ))
raise AllInOneError( msg )

def __getFileInfoList( self, dasLimit ):
if self.__fileInfoList:
Expand Down

0 comments on commit c0332a8

Please sign in to comment.