Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix errors from using published datasets #6429

Merged
merged 1 commit into from Nov 19, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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