本文整理汇总了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)
示例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
示例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
示例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)