From 12d1df672a55c299f530832af9cef36e4f53af3d Mon Sep 17 00:00:00 2001 From: Fredrik Date: Fri, 19 Jul 2024 21:07:01 +0200 Subject: [PATCH 1/2] Fix log message misspellings --- .../WMComponent/AnalyticsDataCollector/Plugins/Tier0Plugin.py | 2 +- src/python/WMComponent/JobCreator/JobCreatorPoller.py | 2 +- src/python/WMCore/Agent/Flow/Generate.py | 2 +- src/python/WMCore/Credential/SimpleMyProxy.py | 2 +- src/python/WMCore/Database/CMSCouch.py | 2 +- src/python/WMCore/MicroService/MSOutput/MSOutput.py | 2 +- src/python/WMCore/ProcessPool/ProcessPool.py | 2 +- src/python/WMCore/Services/ReqMgrAux/ReqMgrAux.py | 2 +- src/python/WMCore/Services/Requests.py | 2 +- src/python/WMCore/Services/WMArchive/DataMap.py | 2 +- src/python/WMCore/WMRuntime/Bootstrap.py | 2 +- src/python/WMCore/WMSpec/Steps/Executors/CMSSW.py | 2 +- src/python/WMCore/WMSpec/Steps/Executors/DQMUpload.py | 2 +- src/python/WMCore/WorkQueue/WorkQueue.py | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/python/WMComponent/AnalyticsDataCollector/Plugins/Tier0Plugin.py b/src/python/WMComponent/AnalyticsDataCollector/Plugins/Tier0Plugin.py index 6bd61a0666..8e06fd14f0 100644 --- a/src/python/WMComponent/AnalyticsDataCollector/Plugins/Tier0Plugin.py +++ b/src/python/WMComponent/AnalyticsDataCollector/Plugins/Tier0Plugin.py @@ -187,7 +187,7 @@ def __call__(self, requestDocs, localSummaryCouchDB, centralRequestCouchDB): centralRequestCouchDB.updateRequestStatus(workflowName, workflowStatus) except Tier0PluginError as t0ex: # More specific exception, just log it anyway - self.logger.error('Error ocurred while processing a doc:\n%s' % str(t0ex)) + self.logger.error('Error occurred while processing a doc:\n%s' % str(t0ex)) except Exception as ex: # Plugins are meant to be not-critical # If something fails then just keep going diff --git a/src/python/WMComponent/JobCreator/JobCreatorPoller.py b/src/python/WMComponent/JobCreator/JobCreatorPoller.py index ade229396b..1336ea324a 100644 --- a/src/python/WMComponent/JobCreator/JobCreatorPoller.py +++ b/src/python/WMComponent/JobCreator/JobCreatorPoller.py @@ -466,7 +466,7 @@ def pollSubscriptions(self): except Exception as ex: msg = "Had failure loading generators for subscription %i\n" % (subscriptionID) msg += "Exception: %s\n" % str(ex) - msg += "Passing over this error. It will reoccur next interation!\n" + msg += "Passing over this error. It will reoccur next iteration!\n" msg += "Please check or remove this subscription!\n" logging.error(msg) continue diff --git a/src/python/WMCore/Agent/Flow/Generate.py b/src/python/WMCore/Agent/Flow/Generate.py index bf895cadae..ab92fc882b 100644 --- a/src/python/WMCore/Agent/Flow/Generate.py +++ b/src/python/WMCore/Agent/Flow/Generate.py @@ -61,7 +61,7 @@ def generate(self): str(self.config.General.srcDir)) os.makedirs(self.config.General.srcDir) except: - print('ERROR: Make sure directory does not exists') + print('ERROR: Make sure directory does not exist already') sys.exit(0) self.parse() print('Starting generation') diff --git a/src/python/WMCore/Credential/SimpleMyProxy.py b/src/python/WMCore/Credential/SimpleMyProxy.py index c5619187e0..a07a288d76 100644 --- a/src/python/WMCore/Credential/SimpleMyProxy.py +++ b/src/python/WMCore/Credential/SimpleMyProxy.py @@ -170,7 +170,7 @@ def myproxy_client(sslctx, op, username, logger, lifetime=43200, host="myproxy.c pem_certs = deserialize_certs(d) if len(pem_certs) != numcerts: raise MyProxyException("%d certs expected, %d received" % (numcerts, len(pem_certs))) - logger.debug("debug: certs deserialized successfuly") + logger.debug("debug: certs deserialized successfully") # return proxy, the corresponding privkey, and then the rest of cert chain data = pem_certs[0] + privkey diff --git a/src/python/WMCore/Database/CMSCouch.py b/src/python/WMCore/Database/CMSCouch.py index 8f1ac91912..910ca60ee0 100644 --- a/src/python/WMCore/Database/CMSCouch.py +++ b/src/python/WMCore/Database/CMSCouch.py @@ -1027,7 +1027,7 @@ def deleteDatabase(self, dbname): check_name(dbname) dbname = urllib.parse.quote_plus(dbname) if "cmsweb" in self.url: - msg = f"You can't be serious that you want to delete a PROODUCTION database!!! " + msg = f"You can't be serious that you want to delete a PRODUCTION database!!! " msg += f"At url: {self.url}, for database name: {dbname}. Bailing out!" raise RuntimeError(msg) return self.delete("/%s" % dbname) diff --git a/src/python/WMCore/MicroService/MSOutput/MSOutput.py b/src/python/WMCore/MicroService/MSOutput/MSOutput.py index 9687acd021..64ec55158a 100644 --- a/src/python/WMCore/MicroService/MSOutput/MSOutput.py +++ b/src/python/WMCore/MicroService/MSOutput/MSOutput.py @@ -30,7 +30,7 @@ class MSOutputException(WMException): General Exception Class for MSOutput Module in WMCore MicroServices """ def __init__(self, message): - self.myMessage = "MSOtputException: %s" % message + self.myMessage = "MSOutputException: %s" % message super(MSOutputException, self).__init__(self.myMessage) diff --git a/src/python/WMCore/ProcessPool/ProcessPool.py b/src/python/WMCore/ProcessPool/ProcessPool.py index 34f508a15f..48eab03597 100644 --- a/src/python/WMCore/ProcessPool/ProcessPool.py +++ b/src/python/WMCore/ProcessPool/ProcessPool.py @@ -304,7 +304,7 @@ def dequeue(self, totalItems=1): self.runningWork -= 1 totalItems -= 1 except Exception as ex: - msg = "Exception while getting slave outputin ProcessPool.\n" + msg = "Exception while getting slave output in ProcessPool.\n" msg += str(ex) logging.error(msg) break diff --git a/src/python/WMCore/Services/ReqMgrAux/ReqMgrAux.py b/src/python/WMCore/Services/ReqMgrAux/ReqMgrAux.py index 1256218e0f..58e43562db 100644 --- a/src/python/WMCore/Services/ReqMgrAux/ReqMgrAux.py +++ b/src/python/WMCore/Services/ReqMgrAux/ReqMgrAux.py @@ -104,7 +104,7 @@ def populateCMSSWVersion(self, tcUrl, **kwargs): resp = self["requests"].put('cmsswversions', cmsswVersions)[0]['result'] if resp and resp[0].get("ok", False): - self["logger"].info("CMSSW document successfuly updated.") + self["logger"].info("CMSSW document successfully updated.") return True msg = "Failed to update CMSSW document. Response: %s" % resp diff --git a/src/python/WMCore/Services/Requests.py b/src/python/WMCore/Services/Requests.py index 0a5ba6aec9..eec84557e7 100644 --- a/src/python/WMCore/Services/Requests.py +++ b/src/python/WMCore/Services/Requests.py @@ -500,7 +500,7 @@ def uploadFile(self, fileName, url, fieldName='file1', params=[], verb='POST'): elif verb == 'PUT': c.setopt(pycurl.CUSTOMREQUEST, 'PUT') else: - raise HTTPException("Verb %s not sopported for upload." % verb) + raise HTTPException("Verb %s not supported for upload." % verb) c.setopt(c.URL, url) fullParams = [(fieldName, (c.FORM_FILE, fileName))] fullParams.extend(params) diff --git a/src/python/WMCore/Services/WMArchive/DataMap.py b/src/python/WMCore/Services/WMArchive/DataMap.py index a438f10d61..2e9f604910 100644 --- a/src/python/WMCore/Services/WMArchive/DataMap.py +++ b/src/python/WMCore/Services/WMArchive/DataMap.py @@ -304,7 +304,7 @@ def convertStepValue(stepValue): stepValue['input'] = convertInput(stepValue['input'][list(stepValue['input'])[0]]) else: - raise Exception("Unknow iput key %s" % list(stepValue['input'])) + raise Exception("Unknown input key %s" % list(stepValue['input'])) if "output" in stepValue: # remove output module name layer diff --git a/src/python/WMCore/WMRuntime/Bootstrap.py b/src/python/WMCore/WMRuntime/Bootstrap.py index d28d29c6e4..1a02cc9bcb 100644 --- a/src/python/WMCore/WMRuntime/Bootstrap.py +++ b/src/python/WMCore/WMRuntime/Bootstrap.py @@ -61,7 +61,7 @@ def getSyncCE(): host = host.split(":")[0] result = host except Exception: - logging.warning("Failed to extract SynCE from globus") + logging.warning("Failed to extract SyncCE from globus") return result if 'NORDUGRID_CE' in os.environ: diff --git a/src/python/WMCore/WMSpec/Steps/Executors/CMSSW.py b/src/python/WMCore/WMSpec/Steps/Executors/CMSSW.py index 7715a04318..eaab9d277a 100644 --- a/src/python/WMCore/WMSpec/Steps/Executors/CMSSW.py +++ b/src/python/WMCore/WMSpec/Steps/Executors/CMSSW.py @@ -171,7 +171,7 @@ def execute(self, emulator=None): architecture=scramArch, ) - logging.info("Runing SCRAM") + logging.info("Running SCRAM") try: projectOutcome = scram.project() except Exception as ex: diff --git a/src/python/WMCore/WMSpec/Steps/Executors/DQMUpload.py b/src/python/WMCore/WMSpec/Steps/Executors/DQMUpload.py index 3c0fb4b352..f97cae90e7 100644 --- a/src/python/WMCore/WMSpec/Steps/Executors/DQMUpload.py +++ b/src/python/WMCore/WMSpec/Steps/Executors/DQMUpload.py @@ -179,7 +179,7 @@ def upd(m, data): logException = False raise Exception(msg) else: - msg = 'HTTP upload finished succesfully with response:\n' + msg + msg = 'HTTP upload finished successfully with response:\n' + msg logging.info(msg) except HTTPError as ex: msg = 'HTTP upload failed with response:\n' diff --git a/src/python/WMCore/WorkQueue/WorkQueue.py b/src/python/WMCore/WorkQueue/WorkQueue.py index 967c344f5b..0a93911254 100644 --- a/src/python/WMCore/WorkQueue/WorkQueue.py +++ b/src/python/WMCore/WorkQueue/WorkQueue.py @@ -594,7 +594,7 @@ def cancelWork(self, elementIDs=None, SubscriptionId=None, WorkflowName=None, el if self.params.get('cancelGraceTime', -1) > 0 and elements: last_update = max([float(x.updatetime) for x in elements]) if (time.time() - last_update) > self.params['cancelGraceTime']: - self.logger.info("%s cancelation has stalled, mark as finished", elements[0]['RequestName']) + self.logger.info("%s cancellation has stalled, mark as finished", elements[0]['RequestName']) # Don't update as fails sometimes due to conflicts (#3856) for x in elements: if not x.inEndState(): From 0bdd662731f1e26154159d3a125f690ba78e1217 Mon Sep 17 00:00:00 2001 From: Fredrik Date: Mon, 22 Jul 2024 23:42:44 +0200 Subject: [PATCH 2/2] It would be tests --- src/python/WMCore/JobSplitting/EventAwareLumiBased.py | 2 +- src/python/WMCore/JobSplitting/EventAwareLumiByWork.py | 2 +- test/python/WMCore_t/JobSplitting_t/EventAwareLumiBased_t.py | 4 ++-- test/python/WMCore_t/JobSplitting_t/EventAwareLumiByWork_t.py | 4 ++-- .../WMCore_t/WMBS_t/JobSplitting_t/EventAwareLumiBased_t.py | 4 ++-- .../WMCore_t/WMBS_t/JobSplitting_t/EventAwareLumiByWork_t.py | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/python/WMCore/JobSplitting/EventAwareLumiBased.py b/src/python/WMCore/JobSplitting/EventAwareLumiBased.py index 748e2fa9ab..ef76655d3f 100644 --- a/src/python/WMCore/JobSplitting/EventAwareLumiBased.py +++ b/src/python/WMCore/JobSplitting/EventAwareLumiBased.py @@ -261,7 +261,7 @@ def algorithm(self, *args, **kwargs): msg = None if failNextJob: msg = "File %s has a single lumi %s, in run %s " % (f['lfn'], lumi, run.run) - msg += "with too many events %d and it woud take %d sec to run" \ + msg += "with too many events %d and it would take %d sec to run" \ % (f['events'], timePerLumi) self.lumiChecker.closeJob(self.currentJob) self.newJob(name=self.getJobName(), failedJob=failNextJob, failedReason=msg, failedErrCode=99305) diff --git a/src/python/WMCore/JobSplitting/EventAwareLumiByWork.py b/src/python/WMCore/JobSplitting/EventAwareLumiByWork.py index 107ef4f165..a83dd4718f 100644 --- a/src/python/WMCore/JobSplitting/EventAwareLumiByWork.py +++ b/src/python/WMCore/JobSplitting/EventAwareLumiByWork.py @@ -152,7 +152,7 @@ def algorithm(self, *args, **kwargs): if timePerLumi > jobTimeLimit and len(lumisByFile[lfn].getLumis()): # This lumi has too many events. Output this job and a new one with just that lumi failReason = "File %s has a single lumi %s, in run %s " % (lfn, lumi, run) - failReason += "with too many events %d and it woud take %d sec to run" \ + failReason += "with too many events %d and it would take %d sec to run" \ % (self.eventsInLumi, timePerLumi) self.stopAndMakeJob(reason='Lumi too big', runLumi=(run, lumi), failNextJob=True, failReason=failReason) diff --git a/test/python/WMCore_t/JobSplitting_t/EventAwareLumiBased_t.py b/test/python/WMCore_t/JobSplitting_t/EventAwareLumiBased_t.py index 0e9c80a1e3..be3f98751b 100644 --- a/test/python/WMCore_t/JobSplitting_t/EventAwareLumiBased_t.py +++ b/test/python/WMCore_t/JobSplitting_t/EventAwareLumiBased_t.py @@ -518,7 +518,7 @@ def testE_HardLimitSpltting(self): failedJobs = [job for job in jobs if job.get('failedOnCreation', False)] self.assertEqual(len(failedJobs), 1) self.assertEqual(failedJobs[0]['failedReason'], - 'File /this/is/file2 has a single lumi 1, in run 1 with too many events 1000 and it woud take 12000 sec to run') + 'File /this/is/file2 has a single lumi 1, in run 1 with too many events 1000 and it would take 12000 sec to run') return @@ -572,7 +572,7 @@ def testF_HardLimitSplittingOnly(self): self.assertEqual(len(finalLumi), 1) self.assertEqual(jobs[i]['failedReason'], - "File /this/is/file%d has a single lumi %s, in run %s with too many events 1000 and it woud take 12000 sec to run" % ( + "File /this/is/file%d has a single lumi %s, in run %s with too many events 1000 and it would take 12000 sec to run" % ( i + 1, finalLumi[0], runNums[0])) return diff --git a/test/python/WMCore_t/JobSplitting_t/EventAwareLumiByWork_t.py b/test/python/WMCore_t/JobSplitting_t/EventAwareLumiByWork_t.py index 93dc255c00..bbad685e16 100644 --- a/test/python/WMCore_t/JobSplitting_t/EventAwareLumiByWork_t.py +++ b/test/python/WMCore_t/JobSplitting_t/EventAwareLumiByWork_t.py @@ -409,7 +409,7 @@ def testHardLimitSplitting(self): for jobNum in (0, 1, 3, 4): self.assertFalse(jobs[jobNum].get('failedOnCreation')) self.assertTrue(jobs[2]['failedOnCreation']) - self.assertEqual(jobs[2]['failedReason'], 'File /this/is/file2 has a single lumi 1, in run 1 with too many events 1000 and it woud take 12000 sec to run') + self.assertEqual(jobs[2]['failedReason'], 'File /this/is/file2 has a single lumi 1, in run 1 with too many events 1000 and it would take 12000 sec to run') return @@ -444,7 +444,7 @@ def testHardLimitSplittingOnly(self): self.assertEqual(len(jobs), 3) for job in jobs: self.assertTrue(job['failedOnCreation']) - self.assertIn(' with too many events 1000 and it woud take 12000 sec to run', job['failedReason']) + self.assertIn(' with too many events 1000 and it would take 12000 sec to run', job['failedReason']) return diff --git a/test/python/WMCore_t/WMBS_t/JobSplitting_t/EventAwareLumiBased_t.py b/test/python/WMCore_t/WMBS_t/JobSplitting_t/EventAwareLumiBased_t.py index b30d791d96..3b18d8410e 100644 --- a/test/python/WMCore_t/WMBS_t/JobSplitting_t/EventAwareLumiBased_t.py +++ b/test/python/WMCore_t/WMBS_t/JobSplitting_t/EventAwareLumiBased_t.py @@ -418,7 +418,7 @@ def testC_HardLimitSplitting(self): self.assertEqual(len(jobs), 6, "Six jobs must be in the jobgroup") self.assertTrue(jobs[3]['failedOnCreation'], "The job processing the second file should me marked for failure") self.assertEqual(jobs[3]['failedReason'], - 'File /this/is/file2 has a single lumi 1, in run 1 with too many events 1000 and it woud take 12000 sec to run') + 'File /this/is/file2 has a single lumi 1, in run 1 with too many events 1000 and it would take 12000 sec to run') def testD_HardLimitSplittingOnly(self): """ @@ -462,7 +462,7 @@ def testD_HardLimitSplittingOnly(self): self.assertTrue(jobs[i - 1]['failedOnCreation'], "The job processing the second file should me marked for failure") error = 'File /this/is/file%s has a single lumi %d, in run %s' % (i, i - 1, i - 1) - error += ' with too many events 1000 and it woud take 12000 sec to run' + error += ' with too many events 1000 and it would take 12000 sec to run' self.assertEqual(jobs[i - 1]['failedReason'], error) return diff --git a/test/python/WMCore_t/WMBS_t/JobSplitting_t/EventAwareLumiByWork_t.py b/test/python/WMCore_t/WMBS_t/JobSplitting_t/EventAwareLumiByWork_t.py index 5c7fa11716..75ae00a4f2 100644 --- a/test/python/WMCore_t/WMBS_t/JobSplitting_t/EventAwareLumiByWork_t.py +++ b/test/python/WMCore_t/WMBS_t/JobSplitting_t/EventAwareLumiByWork_t.py @@ -526,7 +526,7 @@ def testHardLimitSplitting(self): self.assertFalse(jobs[jobNum].get('failedOnCreation')) self.assertTrue(jobs[2]['failedOnCreation']) self.assertEqual(jobs[2]['failedReason'], - 'File /this/is/file2 has a single lumi 1, in run 1 with too many events 1000 and it woud take 12000 sec to run') + 'File /this/is/file2 has a single lumi 1, in run 1 with too many events 1000 and it would take 12000 sec to run') return @@ -565,7 +565,7 @@ def testHardLimitSplittingOnly(self): num = list(jobs[i]['mask']['runAndLumis'])[0] self.assertTrue(jobs[i]['failedOnCreation']) error = 'File /this/is/file%s has a single lumi %s, in run %s' % (num, num, num) - error += ' with too many events 1000 and it woud take 12000 sec to run' + error += ' with too many events 1000 and it would take 12000 sec to run' self.assertEqual(jobs[i]['failedReason'], error) return