当前位置: 首页>>代码示例>>Python>>正文


Python CSHelpers.getGOCSites方法代码示例

本文整理汇总了Python中DIRAC.ResourceStatusSystem.Utilities.CSHelpers.getGOCSites方法的典型用法代码示例。如果您正苦于以下问题:Python CSHelpers.getGOCSites方法的具体用法?Python CSHelpers.getGOCSites怎么用?Python CSHelpers.getGOCSites使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DIRAC.ResourceStatusSystem.Utilities.CSHelpers的用法示例。


在下文中一共展示了CSHelpers.getGOCSites方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: doMaster

# 需要导入模块: from DIRAC.ResourceStatusSystem.Utilities import CSHelpers [as 别名]
# 或者: from DIRAC.ResourceStatusSystem.Utilities.CSHelpers import getGOCSites [as 别名]
    def doMaster(self):
        """
      Master method, which looks little bit spaguetti code, sorry !
      - It gets all gocSites.
      
      As there is no bulk query, it compares with what we have on the database.
      It queries a portion of them.
    """

        gocSites = CSHelpers.getGOCSites()
        if not gocSites["OK"]:
            return gocSites
        gocSites = gocSites["Value"]

        #    resQuery = self.rmClient.selectGGUSTicketsCache( meta = { 'columns' : [ 'GocSite' ] } )
        #    if not resQuery[ 'OK' ]:
        #      return resQuery
        #    resQuery = [ element[0] for element in resQuery[ 'Value' ] ]
        #
        #    gocNamesToQuery = set( gocSites ).difference( set( resQuery ) )

        gLogger.info("Processing %s" % ", ".join(gocSites))

        for gocNameToQuery in gocSites:

            #    if gocNameToQuery is None:
            #      self.metrics[ 'failed' ].append( 'None result' )
            #      continue

            result = self.doNew(gocNameToQuery)

            if not result["OK"]:
                self.metrics["failed"].append(result)

        return S_OK(self.metrics)
开发者ID:graciani,项目名称:DIRAC,代码行数:37,代码来源:GGUSTicketsCommand.py

示例2: doMaster

# 需要导入模块: from DIRAC.ResourceStatusSystem.Utilities import CSHelpers [as 别名]
# 或者: from DIRAC.ResourceStatusSystem.Utilities.CSHelpers import getGOCSites [as 别名]
  def doMaster( self ):
    '''
      Master method, which looks little bit spaguetti code, sorry !
      - It gets all sites and transforms them into gocSites.
      - It gets all the storage elements and transforms them into their hosts
      - It gets the fts, the ces and file catalogs.
    '''
        
    gocSites = CSHelpers.getGOCSites()
    if not gocSites[ 'OK' ]:
      return gocSites
    gocSites = gocSites[ 'Value' ]
  
    sesHosts = CSHelpers.getStorageElementsHosts()
    if not sesHosts[ 'OK' ]:
      return sesHosts      
    sesHosts = sesHosts[ 'Value' ]  
    
    resources = sesHosts      
              
    #
    #
    #FIXME: file catalogs need also to use their hosts
    # something similar applies to FTS Channels
    #
    #fts = CSHelpers.getFTS()
    #if fts[ 'OK' ]:
    #  resources = resources + fts[ 'Value' ]
    #fc = CSHelpers.getFileCatalogs()
    #if fc[ 'OK' ]:
    #  resources = resources + fc[ 'Value' ]
    
    ce = CSHelpers.getComputingElements() 
    if ce[ 'OK' ]:
      resources = resources + ce[ 'Value' ]
    
    gLogger.info( 'Processing Sites: %s' % ', '.join( gocSites ) )
    
    siteRes = self.doNew( ( 'Site', gocSites ) )
    if not siteRes[ 'OK' ]:
      self.metrics[ 'failed' ].append( siteRes[ 'Message' ] )

    gLogger.info( 'Processing Resources: %s' % ', '.join( resources ) )

    resourceRes = self.doNew( ( 'Resource', resources ) ) 
    if not resourceRes[ 'OK' ]:
      self.metrics[ 'failed' ].append( resourceRes[ 'Message' ] )
    
    return S_OK( self.metrics )

################################################################################
#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF
开发者ID:cgrefe,项目名称:DIRAC,代码行数:54,代码来源:DowntimeCommand.py

示例3: doMaster

# 需要导入模块: from DIRAC.ResourceStatusSystem.Utilities import CSHelpers [as 别名]
# 或者: from DIRAC.ResourceStatusSystem.Utilities.CSHelpers import getGOCSites [as 别名]
  def doMaster( self ):
    ''' Master method, which looks little bit spaghetti code, sorry !
        - It gets all sites and transforms them into gocSites.
        - It gets all the storage elements and transforms them into their hosts
        - It gets the the CEs (FTS and file catalogs will come).
    '''

    gocSites = CSHelpers.getGOCSites()
    if not gocSites[ 'OK' ]:
      return gocSites
    gocSites = gocSites[ 'Value' ]

    sesHosts = CSHelpers.getStorageElementsHosts()
    if not sesHosts[ 'OK' ]:
      return sesHosts
    sesHosts = sesHosts[ 'Value' ]

    resources = sesHosts
    
    ftsServer = getFTS3Servers()
    if ftsServer[ 'OK' ]:
      resources.extend( ftsServer[ 'Value' ] )
      
    #TODO: file catalogs need also to use their hosts
   
    #fc = CSHelpers.getFileCatalogs()
    #if fc[ 'OK' ]:
    #  resources = resources + fc[ 'Value' ]

    ce = CSHelpers.getComputingElements()
    if ce[ 'OK' ]:
      resources.extend( ce[ 'Value' ] )
       

    gLogger.verbose( 'Processing Sites: %s' % ', '.join( gocSites ) )

    siteRes = self.doNew( ( 'Site', gocSites ) )
    if not siteRes[ 'OK' ]:
      self.metrics[ 'failed' ].append( siteRes[ 'Message' ] )

    gLogger.verbose( 'Processing Resources: %s' % ', '.join( resources ) )

    resourceRes = self.doNew( ( 'Resource', resources ) )
    if not resourceRes[ 'OK' ]:
      self.metrics[ 'failed' ].append( resourceRes[ 'Message' ] )

    return S_OK( self.metrics )

################################################################################
#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF
开发者ID:Kiyoshi-Hayasaka,项目名称:DIRAC,代码行数:52,代码来源:DowntimeCommand.py

示例4: doMaster

# 需要导入模块: from DIRAC.ResourceStatusSystem.Utilities import CSHelpers [as 别名]
# 或者: from DIRAC.ResourceStatusSystem.Utilities.CSHelpers import getGOCSites [as 别名]
    def doMaster(self):
        """ Master method, which looks little bit spaghetti code, sorry !
        - It gets all sites and transforms them into gocSites.
        - It gets all the storage elements and transforms them into their hosts
        - It gets the the CEs (FTS and file catalogs will come).
    """

        gocSites = CSHelpers.getGOCSites()
        if not gocSites["OK"]:
            return gocSites
        gocSites = gocSites["Value"]

        sesHosts = CSHelpers.getStorageElementsHosts()
        if not sesHosts["OK"]:
            return sesHosts
        sesHosts = sesHosts["Value"]

        resources = sesHosts

        ftsServer = getFTS3Servers()
        if ftsServer["OK"]:
            resources.extend(ftsServer["Value"])

        # TODO: file catalogs need also to use their hosts

        # fc = CSHelpers.getFileCatalogs()
        # if fc[ 'OK' ]:
        #  resources = resources + fc[ 'Value' ]

        ce = CSHelpers.getComputingElements()
        if ce["OK"]:
            resources.extend(ce["Value"])

        self.log.verbose("Processing Sites: %s" % ", ".join(gocSites))

        siteRes = self.doNew(("Site", gocSites))
        if not siteRes["OK"]:
            self.metrics["failed"].append(siteRes["Message"])

        self.log.verbose("Processing Resources: %s" % ", ".join(resources))

        resourceRes = self.doNew(("Resource", resources))
        if not resourceRes["OK"]:
            self.metrics["failed"].append(resourceRes["Message"])

        return S_OK(self.metrics)
开发者ID:DIRACGrid,项目名称:DIRAC,代码行数:48,代码来源:DowntimeCommand.py


注:本文中的DIRAC.ResourceStatusSystem.Utilities.CSHelpers.getGOCSites方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。