Esempio n. 1
0
 def getWip(self):
     '''dns解析'''
     try:
         wip = common.getServerWip(self.ip)
         logging.info("外网ip获取结果为:" + str(wip))
         if len(wip) == 0:
             self.statusCheck(False, "获取外网ip失败")
         if len(wip) >= 1:
             self.dianxinIp = wip[0]
             self.liantongIp = wip[0]
             self.xianluType = 1
         if len(wip) >= 2:
             self.liantongIp = wip[1]
             self.xianluType = 2
         #if len(wip) == 1:
         #    self.dns_ip_name = wip[0]
         #else:
         #    self.dns_ip_name = self.server_url
     except Exception, e1:
         self.statusCheck(False, "%s\n获取外网ip失败" % (str(e1)))
Esempio n. 2
0
 def getWip(self):
     '''dns解析'''
     try:
         wip = common.getServerWip(self.ip)
         logging.info("外网ip获取结果为:" + str(wip))
         if len(wip) == 0:
             self.statusCheck(False,"获取外网ip失败")
         if len(wip) >= 1:
             self.dianxinIp = wip[0]
             self.liantongIp = wip[0]
             self.xianluType = 1
         if len(wip) >= 2:
             self.liantongIp = wip[1]
             self.xianluType = 2
         if len(wip) == 1:
             self.dns_ip_name = wip[0]
         else:
             self.dns_ip_name = self.server_url
     except Exception,e1:
         self.statusCheck(False,"%s\n获取外网ip失败"%(str(e1)))