本文整理汇总了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