Skip to content

Commit adcee9a

Browse files
committed
fix (SE): check the protocol only after checking the plugins when checking the occupancy
1 parent a965b05 commit adcee9a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/DIRAC/Resources/Storage/StorageElement.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -438,10 +438,6 @@ def getOccupancy(self, unit="MB", **kwargs):
438438

439439
kwargs["occupancyLFN"] = occupancyLFN
440440

441-
filteredPlugins = self.__filterPlugins("getOccupancy")
442-
if not filteredPlugins:
443-
return S_ERROR(errno.EPROTONOSUPPORT, "No storage plugins to query the occupancy")
444-
445441
# Call occupancy plugin if requested
446442
occupancyPlugin = self.options.get("OccupancyPlugin")
447443
if occupancyPlugin:
@@ -459,6 +455,10 @@ def getOccupancy(self, unit="MB", **kwargs):
459455
except Exception as e:
460456
return S_ERROR(f"Occupancy plugin failed: {str(e)}")
461457

458+
filteredPlugins = self.__filterPlugins("getOccupancy")
459+
if not filteredPlugins:
460+
return S_ERROR(errno.EPROTONOSUPPORT, "No storage plugins to query the occupancy")
461+
462462
# Try all of the storages one by one
463463
for storage in filteredPlugins:
464464
# The result of the plugin is always in B

0 commit comments

Comments
 (0)