本文整理汇总了Python中tomato.devices.Device.getPrepareTasks方法的典型用法代码示例。如果您正苦于以下问题:Python Device.getPrepareTasks方法的具体用法?Python Device.getPrepareTasks怎么用?Python Device.getPrepareTasks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tomato.devices.Device
的用法示例。
在下文中一共展示了Device.getPrepareTasks方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getPrepareTasks
# 需要导入模块: from tomato.devices import Device [as 别名]
# 或者: from tomato.devices.Device import getPrepareTasks [as 别名]
def getPrepareTasks(self):
taskset = Device.getPrepareTasks(self)
assign_template = tasks.Task("assign-template", self._assignTemplate, reverseFn=self._fallbackDestroy)
assign_host = tasks.Task("assign-host", self._assignHost, reverseFn=self._fallbackDestroy)
assign_vmid = tasks.Task("assign-vmid", self._assignVmid, reverseFn=self._fallbackDestroy, after=assign_host)
create_vm = tasks.Task("create-vm", self._createVm, reverseFn=self._fallbackDestroy, after=assign_vmid)
configure_vm = tasks.Task("configure-vm", self._configureVm, reverseFn=self._fallbackDestroy, after=create_vm)
create_interfaces = tasks.Task("create-interfaces", self._createInterfaces, reverseFn=self._fallbackDestroy, after=configure_vm)
taskset.add([assign_template, assign_host, assign_vmid, create_vm, configure_vm, create_interfaces])
return self._adaptTaskset(taskset)
示例2: getPrepareTasks
# 需要导入模块: from tomato.devices import Device [as 别名]
# 或者: from tomato.devices.Device import getPrepareTasks [as 别名]
def getPrepareTasks(self):
taskset = Device.getPrepareTasks(self)
assign_template = tasks.Task("assign-template", self._assignTemplate)
assign_host = tasks.Task("assign-host", self._assignHost)
assign_vmid = tasks.Task("assign-vmid", self._assignVmid, after=assign_host)
create_vm = tasks.Task("create-vm", self._createVm, reverseFn=self._fallbackDestroy, after=assign_vmid)
use_template = tasks.Task("use-template", self._useTemplate, reverseFn=self._fallbackDestroy, after=create_vm)
configure_vm = tasks.Task("configure-vm", self._configureVm, reverseFn=self._fallbackDestroy, after=create_vm)
for iface in self.interfaceSetAll():
taskset.add(tasks.Task("create-interface-%s" % iface.name, self._createIface, args=(iface,), reverseFn=self._fallbackDestroy, after=create_vm))
taskset.add([assign_template, assign_host, assign_vmid, create_vm, use_template, configure_vm])
return self._adaptTaskset(taskset)
示例3: getPrepareTasks
# 需要导入模块: from tomato.devices import Device [as 别名]
# 或者: from tomato.devices.Device import getPrepareTasks [as 别名]
def getPrepareTasks(self):
taskset = Device.getPrepareTasks(self)
taskset.add(tasks.Task("prepare", self._prepareDev))
return taskset