Skip to content

Commit

Permalink
pass string, not bytes, to htcondor.param Fix #8450 (#8452)
Browse files Browse the repository at this point in the history
  • Loading branch information
belforte authored May 31, 2024
1 parent b129645 commit 856d1ef
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/python/HTCondorLocator.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,15 @@ def getSchedd(self, chooserFunction=capacityMetricsChoicesHybrid):
collector = self.getCollector()
schedd = None
try:
collParam = 'COLLECTOR_HOST'
htcondor.param[collParam] = collector.encode('ascii', 'ignore')
htcondor.param['COLLECTOR_HOST'] = collector
coll = htcondor.Collector()
# select from collector crabschedds and pull some add values
# this call returns a list of schedd objects.
schedds = coll.query(htcondor.AdTypes.Schedd, 'CMSGWMS_Type=?="crabschedd"',
['Name', 'DetectedMemory', 'TotalFreeMemoryMB', 'TransferQueueNumUploading',
'TransferQueueMaxUploading','TotalRunningJobs', 'JobsRunning', 'MaxJobsRunning', 'IsOK'])
if not schedds:
raise Exception(f"No CRAB schedds returned by collector query. {collParam} parameter is {htcondor.param['COLLECTOR_HOST']}. Try later")
raise Exception(f"No CRAB schedds returned by collector query. COLLECTOR_HOST parameter is {htcondor.param['COLLECTOR_HOST']}. Try later")

# Get only those schedds that are listed in our external REST configuration
if self.config and "htcondorSchedds" in self.config:
Expand Down Expand Up @@ -181,7 +180,7 @@ def getScheddObjNew(self, schedd):
Return a tuple (schedd, address) containing an object representing the
remote schedd and its corresponding address.
"""
htcondor.param['COLLECTOR_HOST'] = self.getCollector().encode('ascii', 'ignore')
htcondor.param['COLLECTOR_HOST'] = self.getCollector()
coll = htcondor.Collector()
schedds = coll.query(htcondor.AdTypes.Schedd, f"Name=?={classad.quote(schedd)}",
["AddressV1", "CondorPlatform", "CondorVersion", "Machine", "MyAddress", "Name", "MyType",
Expand Down

0 comments on commit 856d1ef

Please sign in to comment.