本文整理汇总了Python中DIRAC.Core.Utilities.Network.getFQDN方法的典型用法代码示例。如果您正苦于以下问题:Python Network.getFQDN方法的具体用法?Python Network.getFQDN怎么用?Python Network.getFQDN使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DIRAC.Core.Utilities.Network
的用法示例。
在下文中一共展示了Network.getFQDN方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: initialize
# 需要导入模块: from DIRAC.Core.Utilities import Network [as 别名]
# 或者: from DIRAC.Core.Utilities.Network import getFQDN [as 别名]
def initialize( self ):
self.logger = gLogger.getSubLogger( "Monitoring" )
self.logger.debug( "Initializing Monitoring Client" )
self.sourceDict[ 'setup' ] = gConfig.getValue( "/DIRAC/Setup" )
self.sourceDict[ 'site' ] = DIRAC.siteName()
if self.sourceDict[ 'componentType' ] == self.COMPONENT_SERVICE:
self.cfgSection = PathFinder.getSystemSection( self.sourceDict[ 'componentName' ] )
elif self.sourceDict[ 'componentType' ] == self.COMPONENT_AGENT:
self.cfgSection = PathFinder.getAgentSection( self.sourceDict[ 'componentName' ] )
self.setComponentLocation( Network.getFQDN() )
elif self.sourceDict[ 'componentType' ] == self.COMPONENT_WEB:
self.cfgSection = "/WebApp"
self.setComponentLocation( 'http://%s' % Network.getFQDN() )
self.setComponentName( 'WebApp' )
elif self.sourceDict[ 'componentType' ] == self.COMPONENT_SCRIPT:
self.cfgSection = "/Script"
else:
raise Exception( "Component type has not been defined" )
gMonitoringFlusher.registerMonitoringClient( self )
# ExitCallback.registerExitCallback( self.forceFlush )
self.__initialized = True
示例2: __init__
# 需要导入模块: from DIRAC.Core.Utilities import Network [as 别名]
# 或者: from DIRAC.Core.Utilities.Network import getFQDN [as 别名]
def __init__( self, optionsDictionary ):
threading.Thread.__init__( self )
self.__interactive = optionsDictionary[ 'Interactive' ]
self.__sleep = optionsDictionary[ 'SleepTime' ]
self._messageQueue = Queue.Queue()
self._Transactions = []
self._alive = True
self._site = optionsDictionary[ 'Site' ]
self._hostname = Network.getFQDN()
self._logLevels = LogLevels()
self._negativeLevel = self._logLevels.getLevelValue( 'ERROR' )
self._positiveLevel = self._logLevels.getLevelValue( 'ALWAYS' )
self._maxBundledMessages = 20
self.setDaemon(1)
self.start()
示例3: siteName
# 需要导入模块: from DIRAC.Core.Utilities import Network [as 别名]
# 或者: from DIRAC.Core.Utilities.Network import getFQDN [as 别名]
def siteName():
"""
Determine and return DIRAC name for current site
"""
global __siteName
if not __siteName:
#FIXME: does this ever happen that we have to use the defaultValue if getValue ???
from DIRAC.Core.Utilities import Network
# Some Defaults if not present in the configuration
fqdn = Network.getFQDN()
if len( fqdn.split( '.' ) ) > 2 :
# Use the last component of the FQDN as country code if there are more than 2 components
_siteName = 'DIRAC.Client.%s' % fqdn.split( '.' )[-1]
else:
# else use local as country code
_siteName = 'DIRAC.Client.local'
__siteName = gConfig.getValue( '/LocalSite/Site', _siteName )
return __siteName
示例4: getHostname
# 需要导入模块: from DIRAC.Core.Utilities import Network [as 别名]
# 或者: from DIRAC.Core.Utilities.Network import getFQDN [as 别名]
def getHostname( self ):
hostname = self.getOption( "/DIRAC/Hostname" )
if not hostname:
return Network.getFQDN()
return hostname
示例5: __generateUniqueClientName
# 需要导入模块: from DIRAC.Core.Utilities import Network [as 别名]
# 或者: from DIRAC.Core.Utilities.Network import getFQDN [as 别名]
def __generateUniqueClientName(self):
hashStr = ":".join((Time.toString(), str(random.random()), Network.getFQDN(), gLogger.getName()))
hexHash = md5(hashStr).hexdigest()
return hexHash