Beispiel #1
0
    def __init__(self, fileToLoadList=None):
        """ C'or

        :param list fileToLoadList: files to load
    """
        self.diracConfigFilePath = os.path.join(DIRAC.rootPath, "etc",
                                                "dirac.cfg")
        if fileToLoadList and isinstance(fileToLoadList, list):
            for fileName in fileToLoadList:
                gConfigurationData.loadFile(fileName)
Beispiel #2
0
    def loadFile(self, fileName):
        """ Load file

        :param str fileName: file name

        :return: S_OK()/S_ERROR()
    """
        return gConfigurationData.loadFile(fileName)
Beispiel #3
0
 def __loadCFGFiles(self):
     """
     Loads possibly several cfg files, in order:
     1. ~/.dirac.cfg
     2. cfg files pointed by DIRACSYSCONFIG env variable (comma-separated)
     3. cfg files specified in addCFGFile calls
     4. cfg files that come from the command line
     """
     errorsList = []
     if "DIRACSYSCONFIG" in os.environ:
         diracSysConfigFiles = os.environ["DIRACSYSCONFIG"].replace(" ", "").split(",")
         for diracSysConfigFile in reversed(diracSysConfigFiles):
             gConfigurationData.loadFile(diracSysConfigFile)
     gConfigurationData.loadFile(os.path.expanduser("~/.dirac.cfg"))
     for fileName in self.additionalCFGFiles:
         gLogger.debug("Loading file %s" % fileName)
         retVal = gConfigurationData.loadFile(fileName)
         if not retVal["OK"]:
             gLogger.debug("Could not load file %s: %s" % (fileName, retVal["Message"]))
             errorsList.append(retVal["Message"])
     for fileName in self.cliAdditionalCFGFiles:
         gLogger.debug("Loading file %s" % fileName)
         retVal = gConfigurationData.loadFile(fileName)
         if not retVal["OK"]:
             gLogger.debug("Could not load file %s: %s" % (fileName, retVal["Message"]))
             errorsList.append(retVal["Message"])
     return errorsList
Beispiel #4
0
 def __loadCFGFiles(self):
     """
 Load ~/.dirac.cfg
 Load cfg files specified in addCFGFile calls
 Load cfg files with come from the command line
 """
     errorsList = []
     if 'DIRACSYSCONFIG' in os.environ:
         gConfigurationData.loadFile(os.environ['DIRACSYSCONFIG'])
     gConfigurationData.loadFile(os.path.expanduser("~/.dirac.cfg"))
     for fileName in self.additionalCFGFiles:
         gLogger.debug("Loading file %s" % fileName)
         retVal = gConfigurationData.loadFile(fileName)
         if not retVal['OK']:
             gLogger.debug("Could not load file %s: %s" %
                           (fileName, retVal['Message']))
             errorsList.append(retVal['Message'])
     for fileName in self.cliAdditionalCFGFiles:
         gLogger.debug("Loading file %s" % fileName)
         retVal = gConfigurationData.loadFile(fileName)
         if not retVal['OK']:
             gLogger.debug("Could not load file %s: %s" %
                           (fileName, retVal['Message']))
             errorsList.append(retVal['Message'])
     return errorsList
 def __loadCFGFiles( self ):
   """
   Load ~/.dirac.cfg
   Load cfg files specified in addCFGFile calls
   Load cfg files with come from the command line
   """
   errorsList = []
   if 'DIRACSYSCONFIG' in os.environ:
     gConfigurationData.loadFile( os.environ[ 'DIRACSYSCONFIG' ] )
   gConfigurationData.loadFile( os.path.expanduser( "~/.dirac.cfg" ) )
   for fileName in self.additionalCFGFiles:
     gLogger.debug( "Loading file %s" % fileName )
     retVal = gConfigurationData.loadFile( fileName )
     if not retVal[ 'OK' ]:
       gLogger.debug( "Could not load file %s: %s" % ( fileName, retVal[ 'Message' ] ) )
       errorsList.append( retVal[ 'Message' ] )
   for fileName in self.cliAdditionalCFGFiles:
     gLogger.debug( "Loading file %s" % fileName )
     retVal = gConfigurationData.loadFile( fileName )
     if not retVal[ 'OK' ]:
       gLogger.debug( "Could not load file %s: %s" % ( fileName, retVal[ 'Message' ] ) )
       errorsList.append( retVal[ 'Message' ] )
   return errorsList
 def loadFile( self, fileName ):
   return gConfigurationData.loadFile( fileName )
 def __init__( self, fileToLoadList = None ):
   self.diracConfigFilePath = os.path.join( DIRAC.rootPath, "etc", "dirac.cfg" )
   if fileToLoadList and type( fileToLoadList ) == types.ListType:
     for fileName in fileToLoadList:
       gConfigurationData.loadFile( fileName )
Beispiel #8
0
 def loadFile(self, fileName):
     return gConfigurationData.loadFile(fileName)
Beispiel #9
0
 def __init__(self, fileToLoadList=None):
     self.diracConfigFilePath = os.path.join(DIRAC.rootPath, "etc",
                                             "dirac.cfg")
     if fileToLoadList and type(fileToLoadList) == types.ListType:
         for fileName in fileToLoadList:
             gConfigurationData.loadFile(fileName)