private void updateHostRoleState(HostRoleCommand hostRoleCommand, ExecutionCommand executionCommand,
                                   CommandReport commandReport) {
    if (commandReport == null) {
      commandReport = createErrorReport("Unknown error condition");
    }

    db.updateHostRoleState(null, hostRoleCommand.getRequestId(),
        hostRoleCommand.getStageId(), executionCommand.getRole(), commandReport);
  }
Stores the status of the task/action
<p/>
If the command report is not specified (null), an error report will be created.

@param hostRoleCommand  the HostRoleCommand for the relevant task
@param executionCommand the ExecutionCommand for the relevant task
@param commandReport    the CommandReport to store
ambari-server/src/main/java/org/apache/ambari/server/serveraction/ServerActionExecutor.java