|
13 | 13 |
|
14 | 14 | """
|
15 | 15 | import errno
|
| 16 | +import os |
| 17 | +from urllib import parse |
16 | 18 | import time
|
17 | 19 |
|
18 | 20 | # from threading import current_thread
|
@@ -108,6 +110,8 @@ def initialize(self):
|
108 | 110 | # name that will be used in DB for assignment tag
|
109 | 111 | self.assignmentTag = gethostname().split(".")[0]
|
110 | 112 |
|
| 113 | + self.workDirectory = self.am_getWorkDirectory() |
| 114 | + |
111 | 115 | res = self.__readConf()
|
112 | 116 |
|
113 | 117 | # We multiply by two because of the two threadPools
|
@@ -165,13 +169,19 @@ def getFTS3Context(self, username, group, ftsServer, threadID):
|
165 | 169 |
|
166 | 170 | log.debug(f"UserDN {userDN}")
|
167 | 171 |
|
| 172 | + # Chose a meaningfull proxy name for easier debugging |
| 173 | + srvName = parse.urlparse(ftsServer).netloc.split(":")[0] |
| 174 | + proxyFile = os.path.join( |
| 175 | + self.workDirectory, f"{int(time.time())}_{username}_{group}_{srvName}_{threadID}.pem" |
| 176 | + ) |
| 177 | + |
168 | 178 | # We dump the proxy to a file.
|
169 | 179 | # It has to have a lifetime of self.proxyLifetime
|
170 | 180 | # Because the FTS3 servers cache it for 2/3rd of the lifetime
|
171 | 181 | # we should make our cache a bit less than 2/3rd of the lifetime
|
172 | 182 | cacheTime = int(2 * self.proxyLifetime / 3) - 600
|
173 | 183 | res = gProxyManager.downloadVOMSProxyToFile(
|
174 |
| - userDN, group, requiredTimeLeft=self.proxyLifetime, cacheTime=cacheTime |
| 184 | + userDN, group, requiredTimeLeft=self.proxyLifetime, cacheTime=cacheTime, filePath=proxyFile |
175 | 185 | )
|
176 | 186 | if not res["OK"]:
|
177 | 187 | return res
|
|
0 commit comments