Skip to content

Commit

Permalink
FUTURIZE: remove has_key
Browse files Browse the repository at this point in the history
  • Loading branch information
mmascher committed Jan 19, 2016
1 parent 94b3252 commit 72d8576
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions bin/crab
Original file line number Diff line number Diff line change
Expand Up @@ -162,16 +162,16 @@ if __name__ == "__main__":
client.logger.info("The server answered with an error.")
if he.status==503 and he.result.find("CMSWEB Error: Service unavailable")!=-1:
client.logger.info("It seems the CMSWEB frontend is not responding. Please check: https://twiki.cern.ch/twiki/bin/viewauth/CMS/ScheduledInterventions")
if he.headers.has_key('X-Error-Detail'):
if 'X-Error-Detail' in he.headers:
client.logger.info('Server answered with: %s' % he.headers['X-Error-Detail'])
if he.headers.has_key('X-Error-Info'):
if 'X-Error-Info' in he.headers:
reason = he.headers['X-Error-Info']
for parname in parametersMapping['on-server']:
tmpmsg = "'%s'" % (parname)
if tmpmsg in reason and parametersMapping['on-server'][parname]['config']:
reason = reason.replace(tmpmsg, tmpmsg.replace(parname, ' or '.join(parametersMapping['on-server'][parname]['config'])))
client.logger.info('Reason is: %s' % reason)
if he.headers.has_key('X-Error-Id'):
if 'X-Error-Id' in he.headers:
client.logger.info('Error Id: %s' % he.headers['X-Error-Id'])
#The following goes to the logfile.
errmsg = "ERROR: %s (%s): " % (he.reason, he.status)
Expand Down
4 changes: 2 additions & 2 deletions test/python/CRABClient_t/JobType_t/CMSSW_t.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ def testSpecKeys(self):
cmssw = CMSSW(config=testWMConfig, logger=self.logger, workingdir=None)
_dummy, configArguments = cmssw.run(self.reqConfig)
self.assertTrue(len(configArguments['InputDataset']) > 0)
self.assertTrue(configArguments.has_key('ProcessingVersion'))
self.assertTrue(configArguments.has_key('AnalysisConfigCacheDoc'))
self.assertTrue('ProcessingVersion' in configArguments)
self.assertTrue('AnalysisConfigCacheDoc' in configArguments)


def testValidateConfig(self):
Expand Down

0 comments on commit 72d8576

Please sign in to comment.