本文整理匯總了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