def updateCommandApply(self, dct):
        '''
        Called from a RN with a json desc of a command (ie rendernode info, command info etc).
        Raise an execption to tell caller to send a HTTP404 response to RN, if not error a HTTP200 will be send instead
        '''
        log = logging.getLogger('main.dispatcher')
        commandId = dct['id']
        renderNodeName = dct['renderNodeName']

        try:
            command = self.dispatchTree.commands[commandId]
        except __HOLE__:
            raise KeyError("Command not found: %d" % commandId)

        if not command.renderNode:
            # souldn't we reassign the command to the rn??
            raise KeyError("Command %d (%d) is no longer registered on rendernode %s" % (commandId, int(dct['status']), renderNodeName))
        elif command.renderNode.name != renderNodeName:
            # in this case, kill the command running on command.renderNode.name
            # rn = command.renderNode
            # rn.clearAssignment(command)
            # rn.request("DELETE", "/commands/" + str(commandId) + "/")
            log.warning("The emitting RN %s is different from the RN assigned to the command in pulimodel: %s." % (renderNodeName, command.renderNode.name))
            raise KeyError("Command %d is running on a different rendernode (%s) than the one in puli's model (%s)." % (commandId, renderNodeName, command.renderNode.name))

        rn = command.renderNode
        rn.lastAliveTime = max(time.time(), rn.lastAliveTime)

        # if command is no more in the rn's list, it means the rn was reported as timeout or asynchronously removed from RN
        if commandId not in rn.commands:
            if len(rn.commands) == 0 and command.status is not enums.CMD_CANCELED:
                # in this case, re-add the command to the list of the rendernode
                rn.commands[commandId] = command
                # we should re-reserve the lic
                rn.reserveLicense(command, self.licenseManager)
                log.warning("re-assigning command %d on %s. (TIMEOUT?)" % (commandId, rn.name))

            # Command is already remove from RN at this point (it happens when receiving a CANCEL order from external GUI)
            # else:
            #     # The command has been cancelled on the dispatcher but update from RN only arrives now
            #     log.warning("Status update for %d (%d) from %s but command is currently assigned." % (commandId, int(dct['status']), renderNodeName))

        if "status" in dct:
            command.status = int(dct['status'])

        if "completion" in dct and command.status == enums.CMD_RUNNING:
            command.completion = float(dct['completion'])

        command.message = dct['message']

        if "validatorMessage" in dct:
            command.validatorMessage = dct['validatorMessage']
            command.errorInfos = dct['errorInfos']
            if command.validatorMessage:
                command.status = enums.CMD_ERROR

        # Stats info received and not none. Means we need to update it on the command.
        # If stats received is none, no change on the worker, we do not update the command.
        if "stats" in dct and dct["stats"] is not None:
            command.stats = dct["stats"]
dataset/ETHPy150Open mikrosimage/OpenRenderManagement/src/octopus/dispatcher/dispatcher.py/Dispatcher.updateCommandApply