def getLocalIp(self):
i = 0
local_ip = None
# ????local_ip???local_ip??cmd_agent???????????
while i < 3:
gevent.sleep(3)
sys_conf = os.path.join(_agentBasePath , "conf","sysconf.ini")
conf = ConfigParser.ConfigParser()
conf.optionxform = str
if os.path.exists(sys_conf):
conf.read(sys_conf)
if conf.has_section('sys'):
local_ip = conf.get('sys','local_ip')
if local_ip:
break
else:
# ?????????logger????????logger
logger.error('not found local_ip, will retry')
i += 1
return local_ip
评论列表
文章目录