Example #1
0
def mock_StorageFactory_generateStorageObject(storageName,
                                              pluginName,
                                              parameters,
                                              hideExceptions=False):
    """ Generate fake storage object"""
    storageObj = StorageBase(storageName, parameters)

    if pluginName == "SRM2":
        storageObj = fake_SRM2Plugin(storageName, parameters)
        storageObj.protocolParameters['InputProtocols'] = [
            'file', 'root', 'srm'
        ]
        storageObj.protocolParameters['OutputProtocols'] = [
            'file', 'root', 'dcap', 'gsidcap', 'rfio', 'srm'
        ]
    elif pluginName == "File":
        # Not needed to do anything, StorageBase should do it :)
        pass
    elif pluginName == 'XROOT':
        storageObj = fake_XROOTPlugin(storageName, parameters)
        storageObj.protocolParameters['InputProtocols'] = ['file', 'root']
        storageObj.protocolParameters['OutputProtocols'] = ['root']
    elif pluginName == 'GSIFTP':
        storageObj = fake_GSIFTPPlugin(storageName, parameters)
        storageObj.protocolParameters['InputProtocols'] = ['file', 'gsiftp']
        storageObj.protocolParameters['OutputProtocols'] = ['gsiftp']

    storageObj.pluginName = pluginName

    return S_OK(storageObj)
Example #2
0
def mock_StorageFactory_generateStorageObject(storageName,
                                              pluginName,
                                              parameters,
                                              hideExceptions=False):
    """Generate fake storage object"""
    storageObj = StorageBase(storageName, parameters)

    if pluginName == "SRM2":
        storageObj = fake_SRM2Plugin(storageName, parameters)
        storageObj.protocolParameters["InputProtocols"] = [
            "file", "root", "srm"
        ]
        storageObj.protocolParameters["OutputProtocols"] = [
            "file", "root", "dcap", "gsidcap", "rfio", "srm"
        ]
    elif pluginName == "File":
        # Not needed to do anything, StorageBase should do it :)
        pass
    elif pluginName == "XROOT":
        storageObj = fake_XROOTPlugin(storageName, parameters)
        storageObj.protocolParameters["InputProtocols"] = ["file", "root"]
        storageObj.protocolParameters["OutputProtocols"] = ["root"]
    elif pluginName == "GSIFTP":
        storageObj = fake_GSIFTPPlugin(storageName, parameters)
        storageObj.protocolParameters["InputProtocols"] = ["file", "gsiftp"]
        storageObj.protocolParameters["OutputProtocols"] = ["gsiftp"]

    storageObj.pluginName = pluginName

    return S_OK(storageObj)
Example #3
0
def mock_StorageFactory_generateStorageObject(self,
                                              storageName,
                                              pluginName,
                                              parameters,
                                              hideExceptions=False):  # pylint: disable=unused-argument
    """Generate fake storage object"""
    storageObj = StorageBase(storageName, parameters)
    storageObj.pluginName = pluginName

    return S_OK(storageObj)
Example #4
0
def mock_StorageFactory_generateStorageObject( storageName, pluginName, parameters, hideExceptions = False ):
  """ Generate fake storage object"""
  storageObj = StorageBase( storageName, parameters )

  if pluginName == "SRM2":
    storageObj = fake_SRM2Plugin( storageName, parameters )
    storageObj.protocolParameters['InputProtocols'] = ['file', 'root', 'srm']
    storageObj.protocolParameters['OutputProtocols'] = ['file', 'root', 'dcap', 'gsidcap', 'rfio', 'srm']
  elif pluginName == "File":
    # Not needed to do anything, StorageBase should do it :)
    pass
  elif pluginName == 'XROOT':
    storageObj = fake_XROOTPlugin( storageName, parameters )
    storageObj.protocolParameters['InputProtocols'] = ['file', 'root']
    storageObj.protocolParameters['OutputProtocols'] = ['root']

  storageObj.pluginName = pluginName

  return S_OK( storageObj )