DIRACGrid/DIRAC — Issue #402: Loading catalogs
Author: phicharp
Created: 2012-01-05 11:11:09+00:00
State: open

When catalogs are imported, there is a first check on the existence of the file, assuming the base directory where it is thought to be:

gLogger.verbose( "Trying to load from root path %s" % moduleRootPath )
moduleFile = os.path.join( rootPath, moduleRootPath, "Resources", "Catalog", "%sClient.py" % catalogType )
gLogger.verbose( "Looking for file %s" % moduleFile )
if not os.path.isfile( moduleFile ):
continue
try:
# This inforces the convention that the plug in must be named after the file catalog
moduleName = "%sClient" % ( catalogType )
catalogModule = __import__( '%s.Resources.Catalog.%s' % ( moduleRootPath, moduleName ),
globals(), locals(), [moduleName] )
except Exception, x:
errStr = "FileCatalog._generateCatalogObject: Failed to import %s: %s" % ( catalogType, x )
gLogger.exception( errStr )
return S_ERROR( errStr )

Is this absolutely necessary?
When having a local incomplete installation of Dirac, this is inconvenient as rootPath points to the local path and therefore one must getpack DIRAC/Resources for it to work.
My feeling is that removing the check on the file and treating the error less severely would make the job?