def iterOnCommands(self):
        try:
            # Get next command in generator
            cmd = self.gen.next()
            cmd.cancel()
            tornado.ioloop.IOLoop.instance().add_callback(self.iterOnCommands)
        except StopIteration:
            self.finish()
Cancel each command in a node hierarchy (command is given by a generator on the node)
dataset/ETHPy150Open mikrosimage/OpenRenderManagement/src/octopus/dispatcher/webservice/nodes.py/NodeStatusResource.iterOnCommands