本文整理匯總了Python中tomato.devices.Device.getStartTasks方法的典型用法代碼示例。如果您正苦於以下問題:Python Device.getStartTasks方法的具體用法?Python Device.getStartTasks怎麽用?Python Device.getStartTasks使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類tomato.devices.Device
的用法示例。
在下文中一共展示了Device.getStartTasks方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: getStartTasks
# 需要導入模塊: from tomato.devices import Device [as 別名]
# 或者: from tomato.devices.Device import getStartTasks [as 別名]
def getStartTasks(self):
taskset = Device.getStartTasks(self)
start_vm = tasks.Task("start-vm", self._startVm, reverseFn=self._fallbackStop)
for iface in self.interfaceSetAll():
taskset.add(tasks.Task("start-interface-%s" % iface, self._startIface, args=(iface,), reverseFn=self._fallbackStop, after=start_vm))
assign_vnc_port = tasks.Task("assign-vnc-port", self._assignVncPort, reverseFn=self._fallbackStop)
start_vnc = tasks.Task("start-vnc", self._startVnc, reverseFn=self._fallbackStop, after=[start_vm, assign_vnc_port])
taskset.add([start_vm, assign_vnc_port, start_vnc])
return self._adaptTaskset(taskset)
示例2: getStartTasks
# 需要導入模塊: from tomato.devices import Device [as 別名]
# 或者: from tomato.devices.Device import getStartTasks [as 別名]
def getStartTasks(self):
taskset = Device.getStartTasks(self)
create_bridges = tasks.Task("create-bridges", self._createBridges, reverseFn=self._fallbackStop)
start_vm = tasks.Task("start-vm", self._startVm, reverseFn=self._fallbackStop, after=create_bridges)
check_interfaces_exist = tasks.Task("check-interfaces-exist", self._checkInterfacesExist, reverseFn=self._fallbackStop, after=start_vm)
for iface in self.interfaceSetAll():
ts = iface.upcast().getStartTasks()
ts.prefix(iface).after(check_interfaces_exist)
taskset.add(ts)
configure_routes = tasks.Task("configure-routes", self._configureRoutes, reverseFn=self._fallbackStop, after=start_vm)
assign_vnc_port = tasks.Task("assign-vnc-port", self._assignVncPort, reverseFn=self._fallbackStop)
start_vnc = tasks.Task("start-vnc", self._startVnc, reverseFn=self._fallbackStop, after=[start_vm, assign_vnc_port])
taskset.add([create_bridges, start_vm, check_interfaces_exist, configure_routes, assign_vnc_port, start_vnc])
return self._adaptTaskset(taskset)
示例3: getStartTasks
# 需要導入模塊: from tomato.devices import Device [as 別名]
# 或者: from tomato.devices.Device import getStartTasks [as 別名]
def getStartTasks(self):
taskset = Device.getStartTasks(self)
taskset.add(tasks.Task("start", self._startDev))
return taskset