當前位置: 首頁>>代碼示例>>Python>>正文


Python Logging.warning方法代碼示例

本文整理匯總了Python中Logging.Logging.warning方法的典型用法代碼示例。如果您正苦於以下問題:Python Logging.warning方法的具體用法?Python Logging.warning怎麽用?Python Logging.warning使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Logging.Logging的用法示例。


在下文中一共展示了Logging.warning方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: run

# 需要導入模塊: from Logging import Logging [as 別名]
# 或者: from Logging.Logging import warning [as 別名]
	def run(self):
		if self.configPath and self.config.sections():
			self.start()
			self.login()
			self.setNetwork()
			output = self.getNetwork()
			self.stop()
			
			return output
		else:
			Logging.warning("Network settings not set. Skipping setting"
							" network on guest '%s'.", self.guest.getHostName())
			
			return {}
開發者ID:jaxxer,項目名稱:aivm,代碼行數:16,代碼來源:Network.py

示例2: insertDNS

# 需要導入模塊: from Logging import Logging [as 別名]
# 或者: from Logging.Logging import warning [as 別名]
	def insertDNS(self, dnsDict):
		conn = libvirt.open(DC.get("virsh", "connect"))
		xmlDesc = self.network.XMLDesc(0)
		
		Logging.debug("Inserting DNS entries: %s" % str(dnsDict))
		
		localDns = self.makeDNS(dnsDict)
		
		networkXml = xml.parseString(xmlDesc)
		dns = networkXml.getElementsByTagName("dns")
		
		if dns:
			dns = dns[0]
			for entry in localDns.getElementsByTagName("host"):
				dns.appendChild(entry)
		else:
			networkXml.documentElement.appendChild(localDns)
		
		
		self.network.destroy()
		self.network.undefine()
		
		self.network = conn.networkDefineXML(networkXml.documentElement.toxml())
		self.network.setAutostart(1)
		self.network.create()
		
		
		values = {'addr': self.getIPv6Address(), 'prefix': self.getIPv6Prefix(),
					'interface': self.getInterface()}
		
		if (DC.has_option("network", "manual-route")
				and DC.get("network", "manual-route", True)):
			cmd = DC.get("network", "manual-route", False, values)
			cmd = cmd.replace("\n", " ")
			
			subprocess.Popen(cmd, shell=True)
		else:
			Logging.warning("Manual route not set. Skipping.")
		
		return
開發者ID:jaxxer,項目名稱:aivm,代碼行數:42,代碼來源:Network.py


注:本文中的Logging.Logging.warning方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。