Ejemplo n.º 1
0
 def createClientSocket( self, addressTuple , **kwargs ):
   if type( addressTuple ) not in ( types.ListType, types.TupleType ):
     return S_ERROR( "hostAdress is not in a tuple form ( 'hostnameorip', port )" )
   self.__checkKWArgs( kwargs )
   result = checkSanity( addressTuple, kwargs )
   if not result[ 'OK' ]:
     return result
   result = gSocketInfoFactory.getSocket( addressTuple, **kwargs )
   if not result[ 'OK' ]:
     return result
   socketInfo = result[ 'Value' ]
   return S_OK( FakeSocket( socketInfo.getSSLSocket(), copies = 1 ) )
Ejemplo n.º 2
0
 def createClientSocket( self, addressTuple , **kwargs ):
   if type( addressTuple ) not in ( types.ListType, types.TupleType ):
     return S_ERROR( "hostAdress is not in a tuple form ( 'hostnameorip', port )" )
   res = gConfig.getOptionsDict( "/DIRAC/ConnConf/%s:%s" % addressTuple[0:2] )
   if res[ 'OK' ]:
     opts = res[ 'Value' ]
     for k in opts:
       if k not in kwargs:
         kwargs[k] = opts[k]
   self.__checkKWArgs( kwargs )
   result = checkSanity( addressTuple, kwargs )
   if not result[ 'OK' ]:
     return result
   result = gSocketInfoFactory.getSocket( addressTuple, **kwargs )
   if not result[ 'OK' ]:
     return result
   socketInfo = result[ 'Value' ]
   return S_OK( FakeSocket( socketInfo.getSSLSocket(), copies = 1 ) )
Ejemplo n.º 3
0
 def createClientSocket(self, addressTuple, **kwargs):
   if not isinstance(addressTuple, (list, tuple)):
     return S_ERROR("hostAdress is not in a tuple form ( 'hostnameorip', port )")
   res = gConfig.getOptionsDict("/DIRAC/ConnConf/%s:%s" % addressTuple[0:2])
   if res['OK']:
     opts = res['Value']
     for k in opts:
       if k not in kwargs:
         kwargs[k] = opts[k]
   self.__checkKWArgs(kwargs)
   result = checkSanity(addressTuple, kwargs)
   if not result['OK']:
     return result
   result = gSocketInfoFactory.getSocket(addressTuple, **kwargs)
   if not result['OK']:
     return result
   socketInfo = result['Value']
   return S_OK(FakeSocket(socketInfo.getSSLSocket(), copies=1))