15
15
from DIRAC .Core .Security .X509Request import X509Request # pylint: disable=import-error
16
16
from DIRAC .Core .Security .VOMS import VOMS
17
17
from DIRAC .Core .Security import Locations
18
- from DIRAC .Core .DISET . RPCClient import RPCClient
18
+ from DIRAC .Core .Base . Client import Client
19
19
20
20
gUsersSync = ThreadSafe .Synchronizer ()
21
21
gProxiesSync = ThreadSafe .Synchronizer ()
@@ -68,7 +68,7 @@ def __refreshUserCache(self, validSeconds=0):
68
68
69
69
:return: S_OK()/S_ERROR()
70
70
"""
71
- rpcClient = RPCClient ( "Framework/ProxyManager" , timeout = 120 )
71
+ rpcClient = Client ( url = "Framework/ProxyManager" , timeout = 120 )
72
72
retVal = rpcClient .getRegisteredUsers (validSeconds )
73
73
if not retVal ["OK" ]:
74
74
return retVal
@@ -151,7 +151,7 @@ def setPersistency(self, userDN, userGroup, persistent):
151
151
persistentFlag = True
152
152
if not persistent :
153
153
persistentFlag = False
154
- rpcClient = RPCClient ( "Framework/ProxyManager" , timeout = 120 )
154
+ rpcClient = Client ( url = "Framework/ProxyManager" , timeout = 120 )
155
155
retVal = rpcClient .setPersistency (userDN , userGroup , persistentFlag )
156
156
if not retVal ["OK" ]:
157
157
return retVal
@@ -196,7 +196,7 @@ def uploadProxy(self, proxy=None, restrictLifeTime=0, rfcIfPossible=False):
196
196
if chain .getDIRACGroup (ignoreDefault = True ).get ("Value" ) or chain .isVOMS ().get ("Value" ):
197
197
return S_ERROR ("Cannot upload proxy with DIRAC group or VOMS extensions" )
198
198
199
- rpcClient = RPCClient ( "Framework/ProxyManager" , timeout = 120 )
199
+ rpcClient = Client ( url = "Framework/ProxyManager" , timeout = 120 )
200
200
# Get a delegation request
201
201
result = rpcClient .requestDelegationUpload (chain .getRemainingSecs ()["Value" ])
202
202
if not result ["OK" ]:
@@ -237,9 +237,9 @@ def downloadProxy(
237
237
req = X509Request ()
238
238
req .generateProxyRequest (limited = limited )
239
239
if proxyToConnect :
240
- rpcClient = RPCClient ( "Framework/ProxyManager" , proxyChain = proxyToConnect , timeout = 120 )
240
+ rpcClient = Client ( url = "Framework/ProxyManager" , proxyChain = proxyToConnect , timeout = 120 )
241
241
else :
242
- rpcClient = RPCClient ( "Framework/ProxyManager" , timeout = 120 )
242
+ rpcClient = Client ( url = "Framework/ProxyManager" , timeout = 120 )
243
243
if token :
244
244
retVal = rpcClient .getProxyWithToken (
245
245
userDN , userGroup , req .dumpRequest ()["Value" ], int (cacheTime + requiredTimeLeft ), token
@@ -322,9 +322,9 @@ def downloadVOMSProxy(
322
322
req = X509Request ()
323
323
req .generateProxyRequest (limited = limited )
324
324
if proxyToConnect :
325
- rpcClient = RPCClient ( "Framework/ProxyManager" , proxyChain = proxyToConnect , timeout = 120 )
325
+ rpcClient = Client ( url = "Framework/ProxyManager" , proxyChain = proxyToConnect , timeout = 120 )
326
326
else :
327
- rpcClient = RPCClient ( "Framework/ProxyManager" , timeout = 120 )
327
+ rpcClient = Client ( url = "Framework/ProxyManager" , timeout = 120 )
328
328
if token :
329
329
retVal = rpcClient .getVOMSProxyWithToken (
330
330
userDN ,
@@ -542,7 +542,7 @@ def deleteProxyBundle(self, idList):
542
542
543
543
:return: S_OK(int)/S_ERROR()
544
544
"""
545
- rpcClient = RPCClient ( "Framework/ProxyManager" , timeout = 120 )
545
+ rpcClient = Client ( url = "Framework/ProxyManager" , timeout = 120 )
546
546
return rpcClient .deleteProxyBundle (idList )
547
547
548
548
def requestToken (self , requesterDN , requesterGroup , numUses = 1 ):
@@ -555,7 +555,7 @@ def requestToken(self, requesterDN, requesterGroup, numUses=1):
555
555
556
556
:return: S_OK(tuple)/S_ERROR() -- tuple contain token, number uses
557
557
"""
558
- rpcClient = RPCClient ( "Framework/ProxyManager" , timeout = 120 )
558
+ rpcClient = Client ( url = "Framework/ProxyManager" , timeout = 120 )
559
559
return rpcClient .generateToken (requesterDN , requesterGroup , numUses )
560
560
561
561
def renewProxy (self , proxyToBeRenewed = None , minLifeTime = 3600 , newProxyLifeTime = 43200 , proxyToConnect = None ):
@@ -641,7 +641,7 @@ def getDBContents(self, condDict={}, sorting=[["UserDN", "DESC"]], start=0, limi
641
641
642
642
:return: S_OK(dict)/S_ERROR() -- dict contain fields, record list, total records
643
643
"""
644
- rpcClient = RPCClient ( "Framework/ProxyManager" , timeout = 120 )
644
+ rpcClient = Client ( url = "Framework/ProxyManager" , timeout = 120 )
645
645
return rpcClient .getContents (condDict , sorting , start , limit )
646
646
647
647
def getVOMSAttributes (self , chain ):
@@ -683,7 +683,7 @@ def getUserProxiesInfo(self):
683
683
684
684
:return: S_OK(dict)/S_ERROR()
685
685
"""
686
- result = RPCClient ( "Framework/ProxyManager" , timeout = 120 ).getUserProxiesInfo ()
686
+ result = Client ( url = "Framework/ProxyManager" , timeout = 120 ).getUserProxiesInfo ()
687
687
if "rpcStub" in result :
688
688
result .pop ("rpcStub" )
689
689
return result
0 commit comments