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

[sweep:integration] RSS fix: test edge case of no sites #7767

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
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
Loading