Skip to content

Commit

Permalink
Merge pull request #7767 from DIRACGridBot/cherry-pick-2-e4064eb30-in…
Browse files Browse the repository at this point in the history
…tegration

[sweep:integration] RSS fix: test edge case of no sites
  • Loading branch information
fstagni authored Aug 28, 2024
2 parents 2aa75fc + 6abaf82 commit dffbf15
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/DIRAC/ResourceStatusSystem/Client/SiteStatus.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@ def getUsableSites(self, siteNames=None):
siteStatusDictRes = self.getSiteStatuses(siteNames)
if not siteStatusDictRes["OK"]:
return siteStatusDictRes
siteStatusList = [x[0] for x in siteStatusDictRes["Value"].items() if x[1] in ["Active", "Degraded"]]

return S_OK(siteStatusList)
if not siteStatusDictRes["Value"]:
return S_OK([])
return S_OK([x[0] for x in siteStatusDictRes["Value"].items() if x[1] in ["Active", "Degraded"]])

def getSites(self, siteState="Active"):
"""
Expand Down Expand Up @@ -203,6 +203,8 @@ def getSites(self, siteState="Active"):
siteStatusDictRes = self.getSiteStatuses()
if not siteStatusDictRes["OK"]:
return siteStatusDictRes
if not siteStatusDictRes["Value"]:
return S_OK([])

if siteState.capitalize() == "All":
# if no siteState is set return everything
Expand Down

0 comments on commit dffbf15

Please sign in to comment.