Example #1
0
  def __init__( self, storageName, parameters ):
    """ """
    self.log = gLogger.getSubLogger( "GFAL2_SRM2Storage", True )
    self.log.debug( "GFAL2_SRM2Storage.__init__: Initializing object" )
    GFAL2_StorageBase.__init__( self, storageName, parameters )
    self.pluginName = 'GFAL2_SRM2'

    # ##
    #    Setting the default SRM parameters here. For methods where this
    #    is not the default there is a method defined in this class, setting
    #    the proper values and then calling the base class method.
    # ##

    self.gfal2requestLifetime = gConfig.getValue( '/Resources/StorageElements/RequestLifeTime', 100 )

    self.gfal2.set_opt_integer( "SRM PLUGIN", "OPERATION_TIMEOUT", self.gfal2Timeout )
    self.gfal2.set_opt_integer( "SRM PLUGIN", "REQUEST_LIFETIME", self.gfal2requestLifetime )
    self.gfal2.set_opt_string( "SRM PLUGIN", "SPACETOKENDESC", self.spaceToken )
    self.gfal2.set_opt_string_list( "SRM PLUGIN", "TURL_PROTOCOLS", self.defaultLocalProtocols )
    def _getExtendedAttributes(self, path):
        """ Hard coding list of attributes and then call the base method of GFAL2_StorageBase

    :param self: self reference
    :param str path: path of which we want extended attributes
    :return S_OK( attributeDict ) if successful. Where the keys of the dict are the attributes and values the respective values
    """

        # hard coding the attributes list for xroot because the plugin returns the wrong values
        # xrootd.* instead of xroot.* see: https://its.cern.ch/jira/browse/DMC-664
        attributes = ['xroot.cksum', 'xroot.space']
        res = GFAL2_StorageBase._getExtendedAttributes(self, path, attributes)
        return res
  def _getExtendedAttributes( self, path ):
    """ Hard coding list of attributes and then call the base method of GFAL2_StorageBase

    :param self: self reference
    :param str path: path of which we want extended attributes
    :return S_OK( attributeDict ) if successful. Where the keys of the dict are the attributes and values the respective values
    """

    # hard coding the attributes list for xroot because the plugin returns the wrong values
    # xrootd.* instead of xroot.* see: https://its.cern.ch/jira/browse/DMC-664
    attributes = ['xroot.cksum', 'xroot.space']
    res = GFAL2_StorageBase._getExtendedAttributes( self, path, attributes )
    return res
    def __init__(self, storageName, parameters):
        """ c'tor

    :param self: self reference
    :param str storageName: SE name
    :param str protocol: protocol to use
    :param str rootdir: base path for vo files
    :param str host: SE host
    :param int port: port to use to communicate with :host:
    :param str spaceToken: space token
    :param str wspath: location of SRM on :host:
    """
        self.log = gLogger.getSubLogger("GFAL2_XROOTStorage", True)
        # # init base class
        GFAL2_StorageBase.__init__(self, storageName, parameters)

        #     self.log.setLevel( "DEBUG" )

        self.pluginName = 'GFAL2_XROOT'

        self.protocolParameters['Port'] = 0
        self.protocolParameters['WSUrl'] = 0
        self.protocolParameters['SpaceToken'] = 0
  def __init__( self, storageName, parameters ):
    """ c'tor

    :param self: self reference
    :param str storageName: SE name
    :param str protocol: protocol to use
    :param str rootdir: base path for vo files
    :param str host: SE host
    :param int port: port to use to communicate with :host:
    :param str spaceToken: space token
    :param str wspath: location of SRM on :host:
    """
    self.log = gLogger.getSubLogger( "GFAL2_XROOTStorage", True )
    # # init base class
    GFAL2_StorageBase.__init__( self, storageName, parameters )

#     self.log.setLevel( "DEBUG" )

    self.pluginName = 'GFAL2_XROOT'

    self.protocolParameters['Port'] = 0
    self.protocolParameters['WSUrl'] = 0
    self.protocolParameters['SpaceToken'] = 0
Example #6
0
  def _getExtendedAttributes( self, path, protocols = False ):
    ''' Changing the TURL_PROTOCOLS option for SRM in case we ask for a specific
        protocol

        :param self: self reference
        :param str path: path on the storage
        :param str protocols: a list of protocols
        :return S_OK( attributeDict ) if successful. Where the keys of the dict are the attributes
                                      and values the respective values
    '''
    if protocols:
      self.gfal2.set_opt_string_list( "SRM PLUGIN", "TURL_PROTOCOLS", protocols )
    res = GFAL2_StorageBase._getExtendedAttributes( self, path )
    self.__setSRMOptionsToDefault()
    return res