DIRAC 9.0.0a59__py3-none-any.whl → 9.0.0a60__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- DIRAC/DataManagementSystem/Agent/RequestOperations/RemoveFile.py +7 -6
- DIRAC/FrameworkSystem/Client/ComponentInstaller.py +4 -2
- DIRAC/WorkloadManagementSystem/Client/DownloadInputData.py +3 -2
- DIRAC/WorkloadManagementSystem/Client/test/Test_Client_DownloadInputData.py +29 -0
- {dirac-9.0.0a59.dist-info → dirac-9.0.0a60.dist-info}/METADATA +1 -1
- {dirac-9.0.0a59.dist-info → dirac-9.0.0a60.dist-info}/RECORD +10 -10
- {dirac-9.0.0a59.dist-info → dirac-9.0.0a60.dist-info}/WHEEL +0 -0
- {dirac-9.0.0a59.dist-info → dirac-9.0.0a60.dist-info}/entry_points.txt +0 -0
- {dirac-9.0.0a59.dist-info → dirac-9.0.0a60.dist-info}/licenses/LICENSE +0 -0
- {dirac-9.0.0a59.dist-info → dirac-9.0.0a60.dist-info}/top_level.txt +0 -0
|
@@ -4,17 +4,17 @@
|
|
|
4
4
|
# Date: 2013/03/25 07:44:19
|
|
5
5
|
########################################################################
|
|
6
6
|
|
|
7
|
-
"""
|
|
7
|
+
""":mod: RemoveFile
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
================
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
.. module: RemoveFile
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
:synopsis: removeFile operation handler
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
.. moduleauthor:: Krzysztof.Ciba@NOSPAMgmail.com
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
removeFile operation handler
|
|
18
18
|
"""
|
|
19
19
|
# #
|
|
20
20
|
# @file RemoveFile.py
|
|
@@ -132,6 +132,7 @@ class RemoveFile(DMSRequestOperationsBase):
|
|
|
132
132
|
self.rmsMonitoringReporter.addRecord(
|
|
133
133
|
self.createRMSRecord("Successful", len(toRemoveDict) - len(bulkRemoval["Value"]))
|
|
134
134
|
)
|
|
135
|
+
toRemoveDict = bulkRemoval["Value"]
|
|
135
136
|
|
|
136
137
|
# # 2nd step - single file removal
|
|
137
138
|
for lfn, opFile in toRemoveDict.items():
|
|
@@ -60,7 +60,6 @@ from collections import defaultdict
|
|
|
60
60
|
|
|
61
61
|
import importlib_metadata as metadata
|
|
62
62
|
import importlib_resources
|
|
63
|
-
import MySQLdb
|
|
64
63
|
from diraccfg import CFG
|
|
65
64
|
from prompt_toolkit import prompt
|
|
66
65
|
|
|
@@ -96,7 +95,6 @@ from DIRAC.Core.Utilities.Extensions import (
|
|
|
96
95
|
findServices,
|
|
97
96
|
)
|
|
98
97
|
from DIRAC.Core.Utilities.File import mkDir, mkLink
|
|
99
|
-
from DIRAC.Core.Utilities.MySQL import MySQL
|
|
100
98
|
from DIRAC.Core.Utilities.PrettyPrint import printTable
|
|
101
99
|
from DIRAC.Core.Utilities.ReturnValues import S_ERROR, S_OK
|
|
102
100
|
from DIRAC.Core.Utilities.Subprocess import systemCall
|
|
@@ -2055,6 +2053,8 @@ class ComponentInstaller:
|
|
|
2055
2053
|
"""
|
|
2056
2054
|
Install requested DB in MySQL server
|
|
2057
2055
|
"""
|
|
2056
|
+
import MySQLdb
|
|
2057
|
+
|
|
2058
2058
|
dbName = MySQLdb.escape_string(dbName.encode()).decode()
|
|
2059
2059
|
if not self.mysqlRootPwd:
|
|
2060
2060
|
rootPwdPath = cfgInstallPath("Database", "RootPwd")
|
|
@@ -2202,6 +2202,8 @@ class ComponentInstaller:
|
|
|
2202
2202
|
"""
|
|
2203
2203
|
Execute MySQL Command
|
|
2204
2204
|
"""
|
|
2205
|
+
from DIRAC.Core.Utilities.MySQL import MySQL
|
|
2206
|
+
|
|
2205
2207
|
if not self.mysqlRootPwd:
|
|
2206
2208
|
return S_ERROR("MySQL root password is not defined")
|
|
2207
2209
|
if dbName not in self.db:
|
|
@@ -243,12 +243,13 @@ class DownloadInputData:
|
|
|
243
243
|
return S_ERROR(msg)
|
|
244
244
|
|
|
245
245
|
def __getDownloadDir(self, incrementCounter=True):
|
|
246
|
+
jobIDPath = str(self.configuration.get("JobIDPath", os.getcwd()))
|
|
246
247
|
if self.inputDataDirectory == "PerFile":
|
|
247
248
|
if incrementCounter:
|
|
248
249
|
self.counter += 1
|
|
249
|
-
return tempfile.mkdtemp(prefix=f"InputData_{self.counter}", dir=
|
|
250
|
+
return tempfile.mkdtemp(prefix=f"InputData_{self.counter}", dir=jobIDPath)
|
|
250
251
|
elif self.inputDataDirectory == "CWD":
|
|
251
|
-
return
|
|
252
|
+
return jobIDPath
|
|
252
253
|
else:
|
|
253
254
|
return self.inputDataDirectory
|
|
254
255
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"""Test for WMS clients."""
|
|
2
2
|
# pylint: disable=protected-access, missing-docstring, invalid-name
|
|
3
3
|
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
import shutil
|
|
4
6
|
import pytest
|
|
5
7
|
|
|
6
8
|
from unittest.mock import MagicMock
|
|
@@ -280,3 +282,30 @@ def test_DLI_execute_NoLocal(mocker, dli, mockSE):
|
|
|
280
282
|
assert res["Value"]["Failed"]
|
|
281
283
|
assert "/a/lfn/1.txt" in res["Value"]["Failed"], res
|
|
282
284
|
assert res["Value"]["Failed"][0] == "/a/lfn/1.txt", res
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
def test_DLI_execute_jobIDPath(mocker, dli, mockSE):
|
|
288
|
+
"""Specify a jobIDPath. Output should be in the jobIDPath directory."""
|
|
289
|
+
mocker.patch("DIRAC.WorkloadManagementSystem.Client.DownloadInputData.gConfig.getValue", return_value=2)
|
|
290
|
+
|
|
291
|
+
# Create the jobIDPath directory
|
|
292
|
+
jobIDPath = Path().cwd() / "job" / "12345"
|
|
293
|
+
jobIDPath.mkdir(parents=True, exist_ok=True)
|
|
294
|
+
|
|
295
|
+
dli.configuration["JobIDPath"] = str(jobIDPath)
|
|
296
|
+
|
|
297
|
+
mocker.patch("DIRAC.WorkloadManagementSystem.Client.DownloadInputData.gConfig.getValue", return_value=2)
|
|
298
|
+
mockObjectSE = mockSE.return_value
|
|
299
|
+
mockObjectSE.getFileMetadata.return_value = S_OK(
|
|
300
|
+
{"Successful": {"/a/lfn/1.txt": {"Cached": 1, "Accessible": 0}}, "Failed": {}}
|
|
301
|
+
)
|
|
302
|
+
dli._downloadFromSE = MagicMock(side_effect=[S_ERROR("Failed to down"), S_OK({"path": jobIDPath / "1.txt"})])
|
|
303
|
+
dli._isCache = MagicMock(return_value=True)
|
|
304
|
+
res = dli.execute(dataToResolve=["/a/lfn/1.txt"])
|
|
305
|
+
|
|
306
|
+
assert res["OK"]
|
|
307
|
+
assert not res["Value"]["Failed"]
|
|
308
|
+
assert "/a/lfn/1.txt" in res["Value"]["Successful"], res
|
|
309
|
+
|
|
310
|
+
# Check that the output path is in the jobIDPath directory
|
|
311
|
+
assert res["Value"]["Successful"]["/a/lfn/1.txt"]["path"] == jobIDPath / "1.txt", res
|
|
@@ -351,7 +351,7 @@ DIRAC/DataManagementSystem/Agent/RequestOperations/PutAndRegister.py,sha256=yajU
|
|
|
351
351
|
DIRAC/DataManagementSystem/Agent/RequestOperations/ReTransfer.py,sha256=UKTx3M9y1R13KUWkCSehWH__LrJC1UT_4Hya8xfbnDY,4470
|
|
352
352
|
DIRAC/DataManagementSystem/Agent/RequestOperations/RegisterFile.py,sha256=21_P-3-qLrCz4H3hvt9bX8c7dZ_7mJYdQOU6QOVxfsc,4858
|
|
353
353
|
DIRAC/DataManagementSystem/Agent/RequestOperations/RegisterReplica.py,sha256=obFQAVy43TCE93X8q9XD0wUzgjsJRV_BpBcasb2dDcs,6647
|
|
354
|
-
DIRAC/DataManagementSystem/Agent/RequestOperations/RemoveFile.py,sha256=
|
|
354
|
+
DIRAC/DataManagementSystem/Agent/RequestOperations/RemoveFile.py,sha256=eXVdBC75bWCSChs4SJLxME_WEGVbnFR7Ce_a5KJzLzU,10409
|
|
355
355
|
DIRAC/DataManagementSystem/Agent/RequestOperations/RemoveReplica.py,sha256=PTXocMcawugGtLhj9lCfFqDRG5D1I8ciFGBeRmrdLGo,8020
|
|
356
356
|
DIRAC/DataManagementSystem/Agent/RequestOperations/ReplicateAndRegister.py,sha256=IMgwgOFYVd6LAG5-5gaqYkjgonDLT78vJBZ_HnAiiG4,27942
|
|
357
357
|
DIRAC/DataManagementSystem/Agent/RequestOperations/StagingCallback.py,sha256=C80Oyd8QEFPXjPRjXeED2WXlBX0hAdtL0JdQfcYHohc,1423
|
|
@@ -491,7 +491,7 @@ DIRAC/FrameworkSystem/Agent/ProxyRenewalAgent.py,sha256=FMOx0IWpTISv7RyIeHg1NYr3
|
|
|
491
491
|
DIRAC/FrameworkSystem/Agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
492
492
|
DIRAC/FrameworkSystem/Agent/test/Test_ComponentSupervisionAgent.py,sha256=JAnTVE7fOAmEpboNhIKE2Arc7ibLoRszAbJ3lW8ReIg,32200
|
|
493
493
|
DIRAC/FrameworkSystem/Client/BundleDeliveryClient.py,sha256=bA9QSQpFy1uBLhfRSoRT9Eld40WGlNDKX95TSAaJjkY,7546
|
|
494
|
-
DIRAC/FrameworkSystem/Client/ComponentInstaller.py,sha256=
|
|
494
|
+
DIRAC/FrameworkSystem/Client/ComponentInstaller.py,sha256=6kwLgZRZBFLoHp4B2pMx7MHVPXNIWpg3CMRlM5qgcCc,97256
|
|
495
495
|
DIRAC/FrameworkSystem/Client/ComponentMonitoringClient.py,sha256=mnHqmezjPcdL8eJbKhVp3a7Fo051SMMt8uoc_pdKaxc,391
|
|
496
496
|
DIRAC/FrameworkSystem/Client/Logger.py,sha256=_zh5KIH_51tFtPiMfL2fe9qOduUDIP_XBSWkqeO189s,313
|
|
497
497
|
DIRAC/FrameworkSystem/Client/NotificationClient.py,sha256=m21yrr0TCPuesVEeDsgq6Yt6Lg3fLb6x1qWmAcL2GOE,2404
|
|
@@ -1143,7 +1143,7 @@ DIRAC/WorkloadManagementSystem/Agent/test/Test_Agent_PushJobAgent.py,sha256=YrQE
|
|
|
1143
1143
|
DIRAC/WorkloadManagementSystem/Agent/test/Test_Agent_SiteDirector.py,sha256=ynC8NJobwWCRzKAKnQi2qhnPzwQypZRzBrwKGtUmmhs,11440
|
|
1144
1144
|
DIRAC/WorkloadManagementSystem/Agent/test/Test_Agent_StalledJobAgent.py,sha256=uLgHSA3ZITeNxlPdgAYHjgUsL3Xa74g8Oy-0JTbX3K4,1938
|
|
1145
1145
|
DIRAC/WorkloadManagementSystem/Client/CPUNormalization.py,sha256=txBgRfnTAY5KykpKRrK1jp5x4FInWjv-Rja4R7Dqdis,5423
|
|
1146
|
-
DIRAC/WorkloadManagementSystem/Client/DownloadInputData.py,sha256=
|
|
1146
|
+
DIRAC/WorkloadManagementSystem/Client/DownloadInputData.py,sha256=JfidM3U2b0z64hk6j0VpQ7fh6eSkRjm1Hw8X-DAspwI,16303
|
|
1147
1147
|
DIRAC/WorkloadManagementSystem/Client/InputDataByProtocol.py,sha256=tjK6L8iNqWOBENcGJbG0yJsQYwGvFLRFcTMNnrusFAI,12837
|
|
1148
1148
|
DIRAC/WorkloadManagementSystem/Client/InputDataResolution.py,sha256=z8K8VKoUH4KtlTPe0mfyVsQKH6BQh80YIUhu61Fpgeg,6162
|
|
1149
1149
|
DIRAC/WorkloadManagementSystem/Client/JobManagerClient.py,sha256=ySi2lxiwuEf8gx3exIbS_HekJRvpXR7q3h2MdwsRcYA,689
|
|
@@ -1175,7 +1175,7 @@ DIRAC/WorkloadManagementSystem/Client/PilotLoggingPlugins/FileCacheLoggingPlugin
|
|
|
1175
1175
|
DIRAC/WorkloadManagementSystem/Client/PilotLoggingPlugins/MQPilotLoggingPlugin.py,sha256=ydt0jbc2F057zEkiA6tb3oi5JN2VFuNmY43ykw8xGT4,2105
|
|
1176
1176
|
DIRAC/WorkloadManagementSystem/Client/PilotLoggingPlugins/PilotLoggingPlugin.py,sha256=MaWB5FhKb4MppfHhosYaS6GJUl99vGSMyHV3VGYn3oE,1415
|
|
1177
1177
|
DIRAC/WorkloadManagementSystem/Client/PilotLoggingPlugins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
1178
|
-
DIRAC/WorkloadManagementSystem/Client/test/Test_Client_DownloadInputData.py,sha256=
|
|
1178
|
+
DIRAC/WorkloadManagementSystem/Client/test/Test_Client_DownloadInputData.py,sha256=QXEmRjc0Jc_omewIOxiosNES7QCD1yvntN1vIPfW3UI,12347
|
|
1179
1179
|
DIRAC/WorkloadManagementSystem/Client/test/Test_Client_WorkloadManagementSystem.py,sha256=nlOplAKQQYdEn89jRbWAChXjaM5-aWt-wY4GxbQXD-c,2291
|
|
1180
1180
|
DIRAC/WorkloadManagementSystem/Client/test/Test_JobReport.py,sha256=QYElAZiyPuMKYSGBRJO0-1K7-0HhEJjSohqC96lWzDs,852
|
|
1181
1181
|
DIRAC/WorkloadManagementSystem/Client/test/Test_TornadoPilotLoggingClient.py,sha256=GRY5TA34FwLNmvVix5U2nT-5Jw1Cs8K5MJtzQ_ZlLBw,596
|
|
@@ -1297,9 +1297,9 @@ DIRAC/tests/Workflow/Integration/exe-script.py,sha256=B_slYdTocEzqfQLRhwuPiLyYUn
|
|
|
1297
1297
|
DIRAC/tests/Workflow/Integration/helloWorld.py,sha256=tBgEHH3ZF7ZiTS57gtmm3DW-Qxgm_57HWHpM-Y8XSws,205
|
|
1298
1298
|
DIRAC/tests/Workflow/Regression/helloWorld.py,sha256=69eCgFuVSYo-mK3Dj2dw1c6g86sF5FksKCf8V2aGVoM,509
|
|
1299
1299
|
DIRAC/tests/Workflow/Regression/helloWorld.xml,sha256=xwydIcFTAHIX-YPfQfyxuQ7hzvIO3IhR3UAF7ORgkGg,5310
|
|
1300
|
-
dirac-9.0.
|
|
1301
|
-
dirac-9.0.
|
|
1302
|
-
dirac-9.0.
|
|
1303
|
-
dirac-9.0.
|
|
1304
|
-
dirac-9.0.
|
|
1305
|
-
dirac-9.0.
|
|
1300
|
+
dirac-9.0.0a60.dist-info/licenses/LICENSE,sha256=uyr4oV6jmjUeepXZPPjkJRwa5q5MrI7jqJz5sVXNblQ,32452
|
|
1301
|
+
dirac-9.0.0a60.dist-info/METADATA,sha256=SNxluakCtKWSHyDq1jPhCq0Y5P8JHLbwbZC31TwpvSo,9957
|
|
1302
|
+
dirac-9.0.0a60.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
1303
|
+
dirac-9.0.0a60.dist-info/entry_points.txt,sha256=rTtMPd5AGCg3zNaKE60PuEVFkSRzQlRG-DC_v9FCylM,16824
|
|
1304
|
+
dirac-9.0.0a60.dist-info/top_level.txt,sha256=RISrnN9kb_mPqmVu8_o4jF-DSX8-h6AcgfkO9cgfkHA,6
|
|
1305
|
+
dirac-9.0.0a60.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|