def dispatch_command(self, dtg, container_id):
        """
        Parse datagram. React on the request.

        :param dtg: Datagram to process
        :param container_id: container id

        :returns: The following tuple
                  (Status, Descrion text of possible error,
                   Whether we need to continue operation)
        """
        b_status = False
        error_text = ''
        b_iterate = True
        command = -1
        try:
            command = dtg.get_command()
        except Exception:
            error_text = "Received message does not have command" \
                         " identifier. continuing."
            b_status = False
            self.logger.error(error_text)
        else:
            self.logger.debug("Received command {0}".format(command))

        prms = dtg.get_exec_params()
        # TODO(takashi): refactor this
        if command == SBUS_CMD_START_DAEMON:
            self.logger.debug('Do SBUS_CMD_START_DAEMON')
            self.logger.debug('prms = %s' % str(prms))
            b_status, error_text = \
                self.process_start_daemon(prms['daemon_language'],
                                          prms['storlet_path'],
                                          prms['storlet_name'],
                                          prms['pool_size'],
                                          prms['uds_path'],
                                          prms['log_level'],
                                          container_id)
        elif command == SBUS_CMD_STOP_DAEMON:
            self.logger.debug('Do SBUS_CMD_STOP_DAEMON')
            b_status, error_text = \
                self.process_kill(prms['storlet_name'])
        elif command == SBUS_CMD_DAEMON_STATUS:
            self.logger.debug('Do SBUS_CMD_DAEMON_STATUS')
            b_status, error_text = \
                self.get_process_status_by_name(prms['storlet_name'])
        elif command == SBUS_CMD_STOP_DAEMONS:
            self.logger.debug('Do SBUS_CMD_STOP_DAEMONS')
            b_status, error_text = self.process_kill_all()
            b_iterate = False
        elif command == SBUS_CMD_HALT:
            self.logger.debug('Do SBUS_CMD_HALT')
            b_status, error_text = self.shutdown_all_processes()
            b_iterate = False
        elif command == SBUS_CMD_PING:
            self.logger.debug('Do SBUS_CMD_PING')
            b_status = True
            error_text = 'OK'
        else:
            b_status = False
            error_text = command % "got unknown command %d"
            self.logger.error(error_text)

        self.logger.debug('Done')
        return b_status, error_text, b_iterate
dataset/ETHPy150Open openstack/storlets/Engine/storlet_daemon_factory/daemon_factory.py/daemon_factory.dispatch_command/swapped operands of `%`