Skip to content

Commit f4dc42d

Browse files
authored
Merge pull request #8673 from Loxeris/fix-pilotSyncAgent-put
fix: fix pilot sync agent put request
2 parents 6d80e39 + 2b8be98 commit f4dc42d

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/DIRAC/WorkloadManagementSystem/Agent/PilotSyncAgent.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,13 @@ def execute(self):
110110
if server.startswith("https://"):
111111
for tf in allFiles:
112112
res = requests.put(
113-
server, data=tf, verify=self.casLocation, cert=self.certAndKeyLocation, timeout=30
113+
f"{server}/{os.path.basename(tf)}",
114+
data=open(tf, "rb"),
115+
verify=self.casLocation,
116+
cert=self.certAndKeyLocation,
117+
timeout=30,
114118
)
115-
if res.status_code not in (200, 202):
119+
if res.status_code not in (200, 201, 202, 204):
116120
self.log.error("Could not upload", f"to {server}: status {res.status_code}")
117121
else: # Assumes this is a DIRAC SE
118122
for tf in allFiles:

0 commit comments

Comments
 (0)