def getOptions( self, sectionPath, listOrdered = True ):
   gRefresher.refreshConfigurationIfNeeded()
   optionList = gConfigurationData.getOptionsFromCFG( sectionPath, ordered = listOrdered )
   if type( optionList ) == types.ListType:
     return S_OK( optionList )
   else:
     return S_ERROR( "Path %s does not exist or it's not a section" % sectionPath )
 def getOptions( self, sectionPath, listOrdered = True ):
   gRefresher.refreshConfigurationIfNeeded()
   optionList = gConfigurationData.getOptionsFromCFG( sectionPath, ordered = listOrdered )
   if type( optionList ) == types.ListType:
     return S_OK( optionList )
   else:
     return S_ERROR( "Path %s does not exist or it's not a section" % sectionPath )
Exemple #3
0
 def getOptionsDict(self, sectionPath):
     gRefresher.refreshConfigurationIfNeeded()
     optionsDict = {}
     optionList = gConfigurationData.getOptionsFromCFG(sectionPath)
     if type(optionList) == types.ListType:
         for option in optionList:
             optionsDict[option] = gConfigurationData.extractOptionFromCFG("%s/%s" % (sectionPath, option))
         return S_OK(optionsDict)
     else:
         return S_ERROR("Path %s does not exist or it's not a section" % sectionPath)
 def getOptionsDict( self, sectionPath ):
   gRefresher.refreshConfigurationIfNeeded()
   optionsDict = {}
   optionList = gConfigurationData.getOptionsFromCFG( sectionPath )
   if type( optionList ) == types.ListType:
     for option in optionList:
       optionsDict[ option ] = gConfigurationData.extractOptionFromCFG( "%s/%s" %
                                                             ( sectionPath, option ) )
     return S_OK( optionsDict )
   else:
     return S_ERROR( "Path %s does not exist or it's not a section" % sectionPath )
Exemple #5
0
def getSystemURLs(system, setup=False, failover=False):
    """Generate url.

    :param str system: system name or full name e.g.: Framework/ProxyManager
    :param str setup: DIRAC setup name, can be defined in dirac.cfg
    :param bool failover: to add failover URLs to end of result list

    :return: dict -- complete urls. e.g. [dips://some-domain:3424/Framework/Service]
    """
    urlDict = {}
    for service in gConfigurationData.getOptionsFromCFG("%s/URLs" % getSystemSection(system, setup=setup)) or []:
        urlDict[service] = getServiceURLs(system, service, setup=setup, failover=failover)
    return urlDict
    def getOptions(self, sectionPath, listOrdered=True):
        """ Get configuration options

        :param str sectionPath: section path
        :param bool listOrdered: ordered

        :return: S_OK(list)/S_ERROR()
    """
        gRefresher.refreshConfigurationIfNeeded()
        optionList = gConfigurationData.getOptionsFromCFG(sectionPath,
                                                          ordered=listOrdered)
        if isinstance(optionList, list):
            return S_OK(optionList)
        else:
            return S_ERROR("Path %s does not exist or it's not a section" %
                           sectionPath)
    def getOptionsDict(self, sectionPath):
        """ Get configuration options in dictionary

        :param str sectionPath: section path

        :return: S_OK(dict)/S_ERROR()
    """
        gRefresher.refreshConfigurationIfNeeded()
        optionsDict = {}
        optionList = gConfigurationData.getOptionsFromCFG(sectionPath)
        if isinstance(optionList, list):
            for option in optionList:
                optionsDict[option] = gConfigurationData.extractOptionFromCFG(
                    "%s/%s" % (sectionPath, option))
            return S_OK(optionsDict)
        else:
            return S_ERROR("Path %s does not exist or it's not a section" %
                           sectionPath)
Exemple #8
0
 def getOptions(self, sectionPath):
     return gConfigurationData.getOptionsFromCFG(sectionPath, self.cfgData)
Exemple #9
0
 def getOptions( self, sectionPath ):
   return gConfigurationData.getOptionsFromCFG( sectionPath, self.cfgData )