本文整理汇总了Python中tomato.devices.Device.getIdUsage方法的典型用法代码示例。如果您正苦于以下问题:Python Device.getIdUsage方法的具体用法?Python Device.getIdUsage怎么用?Python Device.getIdUsage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tomato.devices.Device
的用法示例。
在下文中一共展示了Device.getIdUsage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getIdUsage
# 需要导入模块: from tomato.devices import Device [as 别名]
# 或者: from tomato.devices.Device import getIdUsage [as 别名]
def getIdUsage(self, host):
ids = Device.getIdUsage(self, host)
if self.vnc_port and self.host == host:
ids["port"] = ids.get("port", set()) | set((self.vnc_port,))
if self.vmid and self.host == host:
ids["vmid"] = ids.get("vmid", set()) | set((self.vmid,))
if self.hasAttribute("migration"):
migration = self.getAttribute("migration")
if host.name in migration:
ids["vmid"] |= set((migration[host.name],))
return ids
示例2: getIdUsage
# 需要导入模块: from tomato.devices import Device [as 别名]
# 或者: from tomato.devices.Device import getIdUsage [as 别名]
def getIdUsage(self, host):
ids = Device.getIdUsage(self, host)
if self.vnc_port and self.host == host:
ids["port"] = ids.get("port", set()) | set((self.vnc_port,))
return ids