|
22 | 22 | from DIRAC.Core.Security import Properties
|
23 | 23 | from DIRAC.Core.Utilities.File import getGlobbedTotalSize, mkDir
|
24 | 24 | from DIRAC.Core.Utilities.ObjectLoader import ObjectLoader
|
25 |
| -from DIRAC.DataManagementSystem.Service.StorageElementHandler import getDiskSpace |
26 | 25 | from DIRAC.FrameworkSystem.Utilities.diracx import TheImpersonator
|
27 | 26 |
|
28 | 27 |
|
@@ -210,7 +209,9 @@ def _getFromClient(self, fileId, token, fileSize, fileHelper=None, data=""):
|
210 | 209 |
|
211 | 210 | sbURL = f"SB:{self.__localSEName}|{sbPath}"
|
212 | 211 | assignTo = {key: [(sbURL, assignTo[key])] for key in assignTo}
|
213 |
| - if not (result := self.sandboxDB.assignSandboxesToEntities(assignTo, credDict["username"], credDict["group"]))["OK"]: |
| 212 | + if not (result := self.sandboxDB.assignSandboxesToEntities(assignTo, credDict["username"], credDict["group"]))[ |
| 213 | + "OK" |
| 214 | + ]: |
214 | 215 | return result
|
215 | 216 | return S_OK(sbURL)
|
216 | 217 |
|
@@ -349,26 +350,6 @@ def export_getSandboxesAssignedToEntity(self, entityId):
|
349 | 350 | sbDict[SBType].append(f"SB:{SEName}|{SEPFN}")
|
350 | 351 | return S_OK(sbDict)
|
351 | 352 |
|
352 |
| - ################## |
353 |
| - # Disk space left management |
354 |
| - |
355 |
| - types_getFreeDiskSpace = [] |
356 |
| - |
357 |
| - def export_getFreeDiskSpace(self): |
358 |
| - """Get the free disk space of the storage element |
359 |
| - If no size is specified, terabytes will be used by default. |
360 |
| - """ |
361 |
| - |
362 |
| - return getDiskSpace(self.getCSOption("BasePath", "/opt/dirac/storage/sandboxes")) |
363 |
| - |
364 |
| - types_getTotalDiskSpace = [] |
365 |
| - |
366 |
| - def export_getTotalDiskSpace(self): |
367 |
| - """Get the total disk space of the storage element |
368 |
| - If no size is specified, terabytes will be used by default. |
369 |
| - """ |
370 |
| - return getDiskSpace(self.getCSOption("BasePath", "/opt/dirac/storage/sandboxes"), total=True) |
371 |
| - |
372 | 353 | ##################
|
373 | 354 | # Download sandboxes
|
374 | 355 |
|
|
0 commit comments