Skip to content

Commit d8de07b

Browse files
authored
Merge pull request #8267 from fstagni/90_fixes17
[9.0] fix: there can be jobs to 'Multiple'
2 parents 2828495 + 4c7d90f commit d8de07b

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

src/DIRAC/WorkloadManagementSystem/Agent/StatesAccountingAgent.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,15 @@ def execute(self):
135135
for backend in self.datastores:
136136
if backend.lower() == "monitoring":
137137
site_name = rD["Site"]
138-
rD["Tier"] = site_metadata[site_name]["Tier"]
139-
rD["Type"] = site_metadata[site_name]["Type"]
138+
if site_name not in site_metadata:
139+
self.log.warn(
140+
f"Site {site_name} not found in site metadata, using default values",
141+
)
142+
rD["Tier"] = "4"
143+
rD["Type"] = site_name.split(".")[0]
144+
else:
145+
rD["Tier"] = site_metadata[site_name]["Tier"]
146+
rD["Type"] = site_metadata[site_name]["Type"]
140147
rD["timestamp"] = int(TimeUtilities.toEpochMilliSeconds(now))
141148
self.datastores["Monitoring"].addRecord(rD)
142149

src/DIRAC/WorkloadManagementSystem/Utilities/JobParameters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import multiprocessing
44

5-
from DIRAC import gConfig, gLogger, S_OK
5+
from DIRAC import S_OK, gConfig, gLogger
66
from DIRAC.Core.Utilities.List import fromChar
77

88

src/DIRAC/WorkloadManagementSystem/Utilities/PilotWrapper.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,8 @@ def getPilotFilesCompressedEncodedDict(pilotFiles, proxy=None):
417417
from DIRAC.Core.Security.ProxyFile import writeChainToTemporaryFile # pylint: disable=import-error
418418

419419
retVal = writeChainToTemporaryFile(proxy)
420+
if not retVal["OK"]:
421+
raise RuntimeError("Failed to write proxy to temporary file: %s" % retVal["Message"])
420422
proxyLocation = Path(retVal["Value"])
421423
proxy_string = proxyLocation.read_text()
422424
proxyLocation.unlink()

0 commit comments

Comments
 (0)