當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。