Example #1
0
def getstorage(path,verb=0,ensure=False):
  """Guess the storage system based on the path."""
  if path.startswith('/eos/'):
    from TauFW.PicoProducer.storage.EOS import EOS
    storage = EOS(path,ensure=ensure,verb=verb)
  #elif path.startswith('/castor/'):
  #  storage = Castor(path,verb=verb)
  elif path.startswith('/pnfs/psi.ch/'):
    from TauFW.PicoProducer.storage.T3_PSI import T3_PSI
    storage = T3_PSI(path,ensure=ensure,verb=verb)
  elif path.startswith('/pnfs/desy.de/'):
    from TauFW.PicoProducer.storage.T2_DESY import T2_DESY
    storage = T2_DESY(path,ensure=ensure,verb=verb)
  elif path.startswith("/store/user") and "etp" in host:
    from TauFW.PicoProducer.storage.GridKA_NRG import GridKA_NRG
    storage = GridKA_NRG(path,ensure=ensure,verb=verb)
  elif path.startswith('/pnfs/lcg.cscs.ch/'):
    from TauFW.PicoProducer.storage.T2_PSI import T2_PSI
    storage = T2_PSI(path,ensure=ensure,verb=verb)
  #elif path.startswith('/pnfs/iihe/'):
  #  return T2_IIHE(path,verb=verb)
  else:
    from TauFW.PicoProducer.storage.StorageSystem import Local
    storage = Local(path,ensure=ensure,verb=verb)
    if not os.path.exists(path):
      LOG.warning("Could not find storage directory %r. Make sure it exists and is mounted. "%(path)+\
                  "If it is a special system, you need to subclass StorageSystem, see "
                  "https://github.com/cms-tau-pog/TauFW/tree/master/PicoProducer#Storage-system")
  if verb>=2:
    print ">>> getstorage(%r), %r"%(path,storage)
  return storage
Example #2
0
def getstorage(path, verb=0, ensure=False):
    """Guess the storage system based on the path."""
    if path.startswith('/eos/'):
        from TauFW.PicoProducer.storage.EOS import EOS
        storage = EOS(path, ensure=ensure, verb=verb)
    #elif path.startswith('/castor/'):
    #  storage = Castor(path,verb=verb)
    elif path.startswith('/pnfs/psi.ch/'):
        from TauFW.PicoProducer.storage.T3_PSI import T3_PSI
        storage = T3_PSI(path, ensure=ensure, verb=verb)
    #elif path.startswith('/pnfs/lcg.cscs.ch/'):
    #  storage = T2_PSI(path,verb=verb)
    #elif path.startswith('/pnfs/iihe/'):
    #  return T2_IIHE(path,verb=verb)
    else:
        from TauFW.PicoProducer.storage.StorageSystem import Local
        storage = Local(path, ensure=ensure, verb=verb)
    if verb >= 2:
        print ">>> getstorage(%r), %r" % (path, storage)
    return storage