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

[8.0] RSS fix: some protocols or types are not in GOC #7859

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions src/DIRAC/ResourceStatusSystem/Command/DowntimeCommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def _prepareCommand(self):
else:
elementName = gocSite["Value"]

# The DIRAC se names mean nothing on the grid, but their hosts and service types do mean.
# The DIRAC SE names mean nothing on the grid, but their hosts and service types do mean.
elif elementType == "StorageElement":
# Get the SE object and its protocols
try:
Expand All @@ -162,10 +162,17 @@ def _prepareCommand(self):

# Determine the SE type and update gOCDBServiceType accordingly
se_type = se.options.get("SEType", "")
diskOrTape = ""
if re.search(r"D[1-9]", se_type):
gOCDBServiceType = diracToGOC_conversion[f"disk_{se_protocols[0]}"]
diskOrTape = "disk"
elif re.search(r"T[1-9]", se_type):
gOCDBServiceType = diracToGOC_conversion[f"tape_{se_protocols[0]}"]
diskOrTape = "tape"
# iterate on the protocols and get the first one
for protocol in se_protocols:
dirac_protocol = f"{diskOrTape}_{protocol}"
if dirac_protocol in diracToGOC_conversion:
gOCDBServiceType = diracToGOC_conversion[dirac_protocol]
break

# Get the SE hosts and return an error if none are found
res = getSEHosts(elementName)
Expand All @@ -178,8 +185,10 @@ def _prepareCommand(self):
elementName = seHosts # in this case it will return a list, because there might be more than one host only

elif elementType in ["FTS", "FTS3"]:
gOCDBServiceType = diracToGOC_conversion[elementType]
# WARNING: this method presupposes that the server is an FTS3 type
try:
gOCDBServiceType = diracToGOC_conversion[elementType]
except KeyError: # not a GOC type (? how can this happen ?)
gOCDBServiceType = None
gocSite = getGOCFTSName(elementName)
if not gocSite["OK"]:
self.log.warn("FTS not in Resources/FTSEndpoints/FTS3 ?", elementName)
Expand All @@ -194,7 +203,10 @@ def _prepareCommand(self):
ceType = gConfig.getValue(
cfgPath("Resources", "Sites", siteName.split(".")[0], siteName, "CEs", elementName, "CEType")
)
gOCDBServiceType = diracToGOC_conversion[ceType]
try:
gOCDBServiceType = diracToGOC_conversion[ceType]
except KeyError: # not a GOC type (e.g. SSH CE)
gOCDBServiceType = None

return S_OK((element, elementName, hours, gOCDBServiceType))

Expand Down
Loading