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


Python Network.getFQDN方法代码示例

本文整理汇总了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
开发者ID:DIRACGrid,项目名称:DIRAC,代码行数:23,代码来源:MonitoringClient.py

示例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()
开发者ID:sbel,项目名称:bes3-jinr,代码行数:17,代码来源:RemoteBackend.py

示例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
开发者ID:graciani,项目名称:DIRAC,代码行数:24,代码来源:__init__.py

示例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
开发者ID:IgorPelevanyuk,项目名称:DIRAC,代码行数:7,代码来源:ServiceConfiguration.py

示例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
开发者ID:DIRACGrid,项目名称:DIRAC,代码行数:6,代码来源:MessageClient.py


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